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