Index: services/device/device_service.h |
diff --git a/services/device/device_service.h b/services/device/device_service.h |
index 756c57fdfee87cb7d04ba093519eaa4ce86ba4fa..c4ed1276751911e1f61d33dbedad2bdc477e92d3 100644 |
--- a/services/device/device_service.h |
+++ b/services/device/device_service.h |
@@ -12,6 +12,8 @@ |
#include "device/sensors/public/interfaces/motion.mojom.h" |
#include "device/sensors/public/interfaces/orientation.mojom.h" |
#include "device/vibration/vibration_manager.mojom.h" |
+#include "device/wake_lock/public/interfaces/wake_lock_context_provider.mojom.h" |
+#include "device/wake_lock/wake_lock_service_context.h" |
#include "mojo/public/cpp/bindings/binding_set.h" |
#include "services/device/public/interfaces/fingerprint.mojom.h" |
#include "services/device/public/interfaces/power_monitor.mojom.h" |
@@ -29,9 +31,16 @@ namespace device { |
class PowerMonitorMessageBroadcaster; |
class TimeZoneMonitor; |
+#if defined(OS_ANDROID) |
+std::unique_ptr<service_manager::Service> CreateDeviceService( |
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
+ const WakeLockContextCallback& wake_lock_context_callback); |
+#else |
std::unique_ptr<service_manager::Service> CreateDeviceService( |
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); |
+#endif |
class DeviceService |
: public service_manager::Service, |
@@ -50,10 +59,17 @@ class DeviceService |
public service_manager::InterfaceFactory<mojom::PowerMonitor>, |
public service_manager::InterfaceFactory< |
mojom::ScreenOrientationListener>, |
- public service_manager::InterfaceFactory<mojom::TimeZoneMonitor> { |
+ public service_manager::InterfaceFactory<mojom::TimeZoneMonitor>, |
+ public service_manager::InterfaceFactory<mojom::WakeLockContextProvider> { |
public: |
+#if defined(OS_ANDROID) |
+ DeviceService(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
+ const WakeLockContextCallback& wake_lock_context_callback); |
+#else |
DeviceService(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); |
+#endif |
~DeviceService() override; |
private: |
@@ -103,6 +119,10 @@ class DeviceService |
void Create(const service_manager::Identity& remote_identity, |
mojom::TimeZoneMonitorRequest request) override; |
+ // InterfaceFactory<mojom::WakeLockContextProvider>: |
+ void Create(const service_manager::Identity& remote_identity, |
+ mojom::WakeLockContextProviderRequest request) override; |
+ |
std::unique_ptr<PowerMonitorMessageBroadcaster> |
power_monitor_message_broadcaster_; |
std::unique_ptr<TimeZoneMonitor> time_zone_monitor_; |
@@ -120,6 +140,8 @@ class DeviceService |
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; |
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
+ WakeLockContextCallback wake_lock_context_callback_; |
+ |
DISALLOW_COPY_AND_ASSIGN(DeviceService); |
}; |