mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 709585 - Part 6/6, Connect DOM and hal. r=sicking
--HG-- extra : rebase_source : e8810a8ad310b888cf6e329fce5e0ddcbd94070f
This commit is contained in:
parent
b6bf636f26
commit
1fd380c81a
@ -68,4 +68,6 @@ ifdef ENABLE_TESTS
|
|||||||
DIRS += test
|
DIRS += test
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
include $(topsrcdir)/config/config.mk
|
||||||
|
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
@ -35,9 +35,11 @@
|
|||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
#include "nsDOMClassInfoID.h"
|
|
||||||
|
|
||||||
#include "PowerManager.h"
|
#include "PowerManager.h"
|
||||||
|
#include "nsContentUtils.h"
|
||||||
|
#include "nsDOMClassInfoID.h"
|
||||||
|
#include "nsIPowerManagerService.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
|
||||||
DOMCI_DATA(MozPowerManager, mozilla::dom::power::PowerManager)
|
DOMCI_DATA(MozPowerManager, mozilla::dom::power::PowerManager)
|
||||||
|
|
||||||
@ -57,13 +59,29 @@ NS_IMPL_RELEASE(PowerManager)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
PowerManager::Reboot()
|
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
|
NS_IMETHODIMP
|
||||||
PowerManager::PowerOff()
|
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
|
} // power
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
#include "mozilla/Hal.h"
|
||||||
#include "PowerManagerService.h"
|
#include "PowerManagerService.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
@ -56,13 +57,15 @@ PowerManagerService::GetInstance()
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
PowerManagerService::Reboot()
|
PowerManagerService::Reboot()
|
||||||
{
|
{
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
hal::Reboot();
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
PowerManagerService::PowerOff()
|
PowerManagerService::PowerOff()
|
||||||
{
|
{
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
hal::PowerOff();
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // power
|
} // power
|
||||||
|
Loading…
Reference in New Issue
Block a user