Index: device/generic_sensor/platform_sensor_ambient_light_iio.h |
diff --git a/device/generic_sensor/platform_sensor_ambient_light_iio.h b/device/generic_sensor/platform_sensor_ambient_light_iio.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e9afd6bf410fc2a74c7e27aa46db825c54bb3b31 |
--- /dev/null |
+++ b/device/generic_sensor/platform_sensor_ambient_light_iio.h |
@@ -0,0 +1,44 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_ |
+#define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_ |
+ |
+#include <device/generic_sensor/platform_sensor_iio.h> |
+#include <device/generic_sensor/platform_sensor_utils_iio.h> |
+#include "base/memory/ref_counted.h" |
+ |
+namespace device { |
+ |
+class PlatformSensorAmbientLightIio : public PlatformSensorIio { |
+ public: |
+ PlatformSensorAmbientLightIio( |
+ mojom::SensorType type, |
+ mojo::ScopedSharedBufferMapping mapping, |
+ PlatformSensorProvider* provider, |
+ scoped_refptr<base::SingleThreadTaskRunner> polling_task_runner, |
+ std::unique_ptr<SensorReader> sensor_reader); |
+ |
+ // PollingPlatformSensor implements: |
+ void UpdateReading() override; |
+ |
+ // PlatformSensor implements: |
+ mojom::ReportingMode GetReportingMode() override; |
+ |
+ protected: |
+ // PlatformSensor implements: |
+ ~PlatformSensorAmbientLightIio() override; |
+ PlatformSensorConfiguration GetDefaultConfiguration() override; |
+ |
+ private: |
+ double lux_value_; |
+ std::unique_ptr<SensorReader> sensor_reader_; |
+ base::WeakPtrFactory<PlatformSensorAmbientLightIio> weak_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PlatformSensorAmbientLightIio); |
+}; |
+ |
+} // namespace device |
+ |
+#endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_ |