Backed out changeset 5d81f5f84779

This commit is contained in:
Scott Johnson 2012-01-30 18:44:40 -06:00
parent 198c79f60d
commit 6156151bb3
3 changed files with 29 additions and 6 deletions

View File

@ -68,4 +68,6 @@ ifdef ENABLE_TESTS
DIRS += test
endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk

View File

@ -35,9 +35,11 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsDOMClassInfoID.h"
#include "PowerManager.h"
#include "nsContentUtils.h"
#include "nsDOMClassInfoID.h"
#include "nsIPowerManagerService.h"
#include "nsServiceManagerUtils.h"
DOMCI_DATA(MozPowerManager, mozilla::dom::power::PowerManager)
@ -57,13 +59,29 @@ NS_IMPL_RELEASE(PowerManager)
NS_IMETHODIMP
PowerManager::Reboot()
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
nsCOMPtr<nsIPowerManagerService> pmService =
do_GetService(POWERMANAGERSERVICE_CONTRACTID);
NS_ENSURE_TRUE(pmService, NS_OK);
pmService->Reboot();
return NS_OK;
}
NS_IMETHODIMP
PowerManager::PowerOff()
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
nsCOMPtr<nsIPowerManagerService> pmService =
do_GetService(POWERMANAGERSERVICE_CONTRACTID);
NS_ENSURE_TRUE(pmService, NS_OK);
pmService->PowerOff();
return NS_OK;
}
} // power

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Hal.h"
#include "PowerManagerService.h"
namespace mozilla {
@ -56,13 +57,15 @@ PowerManagerService::GetInstance()
NS_IMETHODIMP
PowerManagerService::Reboot()
{
return NS_ERROR_NOT_IMPLEMENTED;
hal::Reboot();
return NS_OK;
}
NS_IMETHODIMP
PowerManagerService::PowerOff()
{
return NS_ERROR_NOT_IMPLEMENTED;
hal::PowerOff();
return NS_OK;
}
} // power