Chromium Code Reviews| Index: services/device/device_service.cc |
| diff --git a/services/device/device_service.cc b/services/device/device_service.cc |
| index a0aae54d745cd30b2806cbdb39077f33085415c2..6510d98bbab952c5ef8736f837929a59a93cf2db 100644 |
| --- a/services/device/device_service.cc |
| +++ b/services/device/device_service.cc |
| @@ -14,6 +14,7 @@ |
| #include "device/battery/battery_monitor.mojom.h" |
| #include "device/battery/battery_monitor_impl.h" |
| #include "device/battery/battery_status_service.h" |
| +#include "device/generic_sensor/sensor_provider_impl.h" |
| #include "device/sensors/device_sensor_host.h" |
| #include "device/wake_lock/wake_lock_context_provider.h" |
| #include "mojo/public/cpp/system/message_pipe.h" |
| @@ -94,6 +95,7 @@ bool DeviceService::OnConnect(const service_manager::ServiceInfo& remote_info, |
| registry->AddInterface<mojom::OrientationAbsoluteSensor>(this); |
| registry->AddInterface<mojom::PowerMonitor>(this); |
| registry->AddInterface<mojom::ScreenOrientationListener>(this); |
| + registry->AddInterface<mojom::SensorProvider>(this); |
|
blundell
2017/03/27 14:56:52
We should preserve the check about the feature bei
ke.he
2017/03/28 05:41:11
The check code is: "if (base::FeatureList::IsEnabl
blundell
2017/03/28 07:03:52
Ah, great point! You are correct that a dep from /
|
| registry->AddInterface<mojom::TimeZoneMonitor>(this); |
| registry->AddInterface<mojom::WakeLockContextProvider>(this); |
| @@ -215,6 +217,15 @@ void DeviceService::Create(const service_manager::Identity& remote_identity, |
| } |
| void DeviceService::Create(const service_manager::Identity& remote_identity, |
| + mojom::SensorProviderRequest request) { |
| + if (io_task_runner_) { |
| + io_task_runner_->PostTask( |
| + FROM_HERE, base::Bind(&device::SensorProviderImpl::Create, |
| + file_task_runner_, base::Passed(&request))); |
| + } |
| +} |
| + |
| +void DeviceService::Create(const service_manager::Identity& remote_identity, |
| mojom::TimeZoneMonitorRequest request) { |
| if (!time_zone_monitor_) |
| time_zone_monitor_ = TimeZoneMonitor::Create(file_task_runner_); |