OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DEVICE_SENSORS_SENSOR_PROVIDER_IMPL_H_ |
| 6 #define DEVICE_SENSORS_SENSOR_PROVIDER_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "device/sensors/public/interfaces/sensor_provider.mojom.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 11 |
| 12 namespace device { |
| 13 |
| 14 class PlatformSensorProvider; |
| 15 |
| 16 namespace mojom { |
| 17 |
| 18 // Implementation of SensorProvider mojo interface. |
| 19 // Uses PlatformSensorProvider singleton to create platform specific instances |
| 20 // of PlatformSensor which are used by SensorImpl. |
| 21 class SensorProviderImpl final : public SensorProvider { |
| 22 public: |
| 23 static void Create(mojo::InterfaceRequest<SensorProvider> request); |
| 24 |
| 25 ~SensorProviderImpl() override; |
| 26 |
| 27 private: |
| 28 explicit SensorProviderImpl(mojo::InterfaceRequest<SensorProvider> request); |
| 29 |
| 30 // SensorProvider implementation. |
| 31 void GetSensor(device::SensorType type, |
| 32 SensorRequest sensor_request, |
| 33 const GetSensorCallback& callback) override; |
| 34 |
| 35 mojo::StrongBinding<SensorProvider> binding_; |
| 36 static PlatformSensorProvider* s_provider_; |
| 37 DISALLOW_COPY_AND_ASSIGN(SensorProviderImpl); |
| 38 }; |
| 39 |
| 40 } // namespace mojom |
| 41 } // namespace device |
| 42 |
| 43 #endif // DEVICE_SENSORS_SENSOR_PROVIDER_IMPL_H_ |
OLD | NEW |