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_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "device/generic_sensor/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 // Implementation of SensorProvider mojo interface. |
| 17 // Uses PlatformSensorProvider singleton to create platform specific instances |
| 18 // of PlatformSensor which are used by SensorImpl. |
| 19 class SensorProviderImpl final : public mojom::SensorProvider { |
| 20 public: |
| 21 static void Create(mojo::InterfaceRequest<mojom::SensorProvider> request); |
| 22 |
| 23 ~SensorProviderImpl() override; |
| 24 |
| 25 private: |
| 26 explicit SensorProviderImpl( |
| 27 mojo::InterfaceRequest<mojom::SensorProvider> request); |
| 28 |
| 29 // SensorProvider implementation. |
| 30 void GetSensor(mojom::SensorType type, |
| 31 mojom::SensorRequest sensor_request, |
| 32 const GetSensorCallback& callback) override; |
| 33 |
| 34 mojo::StrongBinding<mojom::SensorProvider> binding_; |
| 35 static PlatformSensorProvider* s_provider_; |
| 36 DISALLOW_COPY_AND_ASSIGN(SensorProviderImpl); |
| 37 }; |
| 38 |
| 39 } // namespace device |
| 40 |
| 41 #endif // DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ |
OLD | NEW |