| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SERVICES_DEVICE_DEVICE_SERVICE_H_ | 5 #ifndef SERVICES_DEVICE_DEVICE_SERVICE_H_ |
| 6 #define SERVICES_DEVICE_DEVICE_SERVICE_H_ | 6 #define SERVICES_DEVICE_DEVICE_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "device/battery/battery_monitor.mojom.h" | 9 #include "device/battery/battery_monitor.mojom.h" |
| 10 #include "device/screen_orientation/public/interfaces/screen_orientation.mojom.h
" | 10 #include "device/screen_orientation/public/interfaces/screen_orientation.mojom.h
" |
| 11 #include "device/sensors/public/interfaces/light.mojom.h" | 11 #include "device/sensors/public/interfaces/light.mojom.h" |
| 12 #include "device/sensors/public/interfaces/motion.mojom.h" | 12 #include "device/sensors/public/interfaces/motion.mojom.h" |
| 13 #include "device/sensors/public/interfaces/orientation.mojom.h" | 13 #include "device/sensors/public/interfaces/orientation.mojom.h" |
| 14 #include "device/vibration/vibration_manager.mojom.h" |
| 14 #include "mojo/public/cpp/bindings/binding_set.h" | 15 #include "mojo/public/cpp/bindings/binding_set.h" |
| 15 #include "services/device/public/interfaces/fingerprint.mojom.h" | 16 #include "services/device/public/interfaces/fingerprint.mojom.h" |
| 16 #include "services/device/public/interfaces/power_monitor.mojom.h" | 17 #include "services/device/public/interfaces/power_monitor.mojom.h" |
| 17 #include "services/device/public/interfaces/time_zone_monitor.mojom.h" | 18 #include "services/device/public/interfaces/time_zone_monitor.mojom.h" |
| 18 #include "services/service_manager/public/cpp/interface_factory.h" | 19 #include "services/service_manager/public/cpp/interface_factory.h" |
| 19 #include "services/service_manager/public/cpp/interface_provider.h" | 20 #include "services/service_manager/public/cpp/interface_provider.h" |
| 20 #include "services/service_manager/public/cpp/service.h" | 21 #include "services/service_manager/public/cpp/service.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class SingleThreadTaskRunner; | 24 class SingleThreadTaskRunner; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 36 : public service_manager::Service, | 37 : public service_manager::Service, |
| 37 public service_manager::InterfaceFactory<mojom::Fingerprint>, | 38 public service_manager::InterfaceFactory<mojom::Fingerprint>, |
| 38 public service_manager::InterfaceFactory<mojom::LightSensor>, | 39 public service_manager::InterfaceFactory<mojom::LightSensor>, |
| 39 public service_manager::InterfaceFactory<mojom::MotionSensor>, | 40 public service_manager::InterfaceFactory<mojom::MotionSensor>, |
| 40 public service_manager::InterfaceFactory<mojom::OrientationSensor>, | 41 public service_manager::InterfaceFactory<mojom::OrientationSensor>, |
| 41 public service_manager::InterfaceFactory< | 42 public service_manager::InterfaceFactory< |
| 42 mojom::OrientationAbsoluteSensor>, | 43 mojom::OrientationAbsoluteSensor>, |
| 43 #if !defined(OS_ANDROID) | 44 #if !defined(OS_ANDROID) |
| 44 // On Android the Device Service provides BatteryMonitor via Java. | 45 // On Android the Device Service provides BatteryMonitor via Java. |
| 45 public service_manager::InterfaceFactory<BatteryMonitor>, | 46 public service_manager::InterfaceFactory<BatteryMonitor>, |
| 47 // On Android the Device Service provides VibrationManager via Java. |
| 48 public service_manager::InterfaceFactory<mojom::VibrationManager>, |
| 46 #endif | 49 #endif |
| 47 public service_manager::InterfaceFactory<mojom::PowerMonitor>, | 50 public service_manager::InterfaceFactory<mojom::PowerMonitor>, |
| 48 public service_manager::InterfaceFactory< | 51 public service_manager::InterfaceFactory< |
| 49 mojom::ScreenOrientationListener>, | 52 mojom::ScreenOrientationListener>, |
| 50 public service_manager::InterfaceFactory<mojom::TimeZoneMonitor> { | 53 public service_manager::InterfaceFactory<mojom::TimeZoneMonitor> { |
| 51 public: | 54 public: |
| 52 DeviceService(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, | 55 DeviceService(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
| 53 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); | 56 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); |
| 54 ~DeviceService() override; | 57 ~DeviceService() override; |
| 55 | 58 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 76 mojom::OrientationSensorRequest request) override; | 79 mojom::OrientationSensorRequest request) override; |
| 77 | 80 |
| 78 // InterfaceFactory<mojom::OrientationAbsolueSensor>: | 81 // InterfaceFactory<mojom::OrientationAbsolueSensor>: |
| 79 void Create(const service_manager::Identity& remote_identity, | 82 void Create(const service_manager::Identity& remote_identity, |
| 80 mojom::OrientationAbsoluteSensorRequest request) override; | 83 mojom::OrientationAbsoluteSensorRequest request) override; |
| 81 | 84 |
| 82 #if !defined(OS_ANDROID) | 85 #if !defined(OS_ANDROID) |
| 83 // InterfaceFactory<BatteryMonitor>: | 86 // InterfaceFactory<BatteryMonitor>: |
| 84 void Create(const service_manager::Identity& remote_identity, | 87 void Create(const service_manager::Identity& remote_identity, |
| 85 BatteryMonitorRequest request) override; | 88 BatteryMonitorRequest request) override; |
| 89 // InterfaceFactory<mojom::VibrationManager>: |
| 90 void Create(const service_manager::Identity& remote_identity, |
| 91 mojom::VibrationManagerRequest request) override; |
| 86 #endif | 92 #endif |
| 87 | 93 |
| 88 // InterfaceFactory<mojom::PowerMonitor>: | 94 // InterfaceFactory<mojom::PowerMonitor>: |
| 89 void Create(const service_manager::Identity& remote_identity, | 95 void Create(const service_manager::Identity& remote_identity, |
| 90 mojom::PowerMonitorRequest request) override; | 96 mojom::PowerMonitorRequest request) override; |
| 91 | 97 |
| 92 // InterfaceFactory<mojom::ScreenOrientationListener>: | 98 // InterfaceFactory<mojom::ScreenOrientationListener>: |
| 93 void Create(const service_manager::Identity& remote_identity, | 99 void Create(const service_manager::Identity& remote_identity, |
| 94 mojom::ScreenOrientationListenerRequest request) override; | 100 mojom::ScreenOrientationListenerRequest request) override; |
| 95 | 101 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 113 | 119 |
| 114 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; | 120 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; |
| 115 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 121 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 116 | 122 |
| 117 DISALLOW_COPY_AND_ASSIGN(DeviceService); | 123 DISALLOW_COPY_AND_ASSIGN(DeviceService); |
| 118 }; | 124 }; |
| 119 | 125 |
| 120 } // namespace device | 126 } // namespace device |
| 121 | 127 |
| 122 #endif // SERVICES_DEVICE_DEVICE_SERVICE_H_ | 128 #endif // SERVICES_DEVICE_DEVICE_SERVICE_H_ |
| OLD | NEW |