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 DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_H_ | 5 #ifndef SERVICES_DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_H_ |
6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_H_ | 6 #define SERVICES_DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_H_ |
7 | 7 |
8 #include "device/generic_sensor/generic_sensor_export.h" | 8 #include "services/device/generic_sensor/platform_sensor_provider_base.h" |
9 #include "device/generic_sensor/platform_sensor_provider_base.h" | |
10 | 9 |
11 namespace device { | 10 namespace device { |
12 | 11 |
13 // This a singleton class returning the actual sensor provider | 12 // This a singleton class returning the actual sensor provider |
14 // implementation for the current platform. | 13 // implementation for the current platform. |
15 class DEVICE_GENERIC_SENSOR_EXPORT PlatformSensorProvider | 14 class PlatformSensorProvider : public PlatformSensorProviderBase { |
16 : public PlatformSensorProviderBase { | |
17 public: | 15 public: |
18 // Returns the PlatformSensorProvider singleton. | 16 // Returns the PlatformSensorProvider singleton. |
19 // Note: returns 'nullptr' if there is no available implementation for | 17 // Note: returns 'nullptr' if there is no available implementation for |
20 // the current platform. | 18 // the current platform. |
21 static PlatformSensorProvider* GetInstance(); | 19 static PlatformSensorProvider* GetInstance(); |
22 | 20 |
23 // This method allows to set a provider for testing and therefore | 21 // This method allows to set a provider for testing and therefore |
24 // skip the default platform provider. This allows testing without | 22 // skip the default platform provider. This allows testing without |
25 // relying on the platform provider. | 23 // relying on the platform provider. |
26 static void SetProviderForTesting(PlatformSensorProvider* provider); | 24 static void SetProviderForTesting(PlatformSensorProvider* provider); |
27 | 25 |
28 protected: | 26 protected: |
29 PlatformSensorProvider() = default; | 27 PlatformSensorProvider() = default; |
30 ~PlatformSensorProvider() override = default; | 28 ~PlatformSensorProvider() override = default; |
31 | 29 |
32 DISALLOW_COPY_AND_ASSIGN(PlatformSensorProvider); | 30 DISALLOW_COPY_AND_ASSIGN(PlatformSensorProvider); |
33 }; | 31 }; |
34 | 32 |
35 } // namespace device | 33 } // namespace device |
36 | 34 |
37 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_H_ | 35 #endif // SERVICES_DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_H_ |
OLD | NEW |