Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: device/generic_sensor/platform_sensor_ambient_light_iio.h

Issue 2370343002: [sensors] Ambient light sensor implementation for ChromeOS and Linux. (Closed)
Patch Set: changed implementation Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_
6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_
7
8 #include <device/generic_sensor/platform_sensor_iio.h>
9 #include <device/generic_sensor/platform_sensor_utils_iio.h>
10 #include "base/memory/ref_counted.h"
11
12 namespace device {
13
14 class PlatformSensorAmbientLightIio : public PlatformSensorIio {
15 public:
16 PlatformSensorAmbientLightIio(
17 mojom::SensorType type,
18 mojo::ScopedSharedBufferMapping mapping,
19 PlatformSensorProvider* provider,
20 scoped_refptr<base::SingleThreadTaskRunner> polling_task_runner,
21 std::unique_ptr<SensorReader> sensor_reader);
22
23 // PollingPlatformSensor implements:
24 void UpdateReading() override;
25
26 // PlatformSensor implements:
27 mojom::ReportingMode GetReportingMode() override;
28
29 protected:
30 // PlatformSensor implements:
31 ~PlatformSensorAmbientLightIio() override;
32 PlatformSensorConfiguration GetDefaultConfiguration() override;
33
34 private:
35 double lux_value_;
36 std::unique_ptr<SensorReader> sensor_reader_;
37 base::WeakPtrFactory<PlatformSensorAmbientLightIio> weak_factory_;
38
39 DISALLOW_COPY_AND_ASSIGN(PlatformSensorAmbientLightIio);
40 };
41
42 } // namespace device
43
44 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698