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

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

Issue 2332903002: [sensors] [mac] Implement ambient light sensor for macOS (Closed)
Patch Set: Created 4 years, 3 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_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_MAC_H_
6 #define DEVICE_GENERIC_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_MAC_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "device/generic_sensor/platform_sensor_mac.h"
10
11 namespace base {
12 class SingleThreadTaskRunner;
13 }
14
15 namespace content {
16 class AmbientLightSensor;
17 }
18
19 namespace device {
20
21 class PlatformSensorAmbientLightMac : public PlatformSensorMac {
22 public:
23 PlatformSensorAmbientLightMac(mojom::SensorType type,
24 mojo::ScopedSharedBufferMapping mapping,
25 uint64_t buffer_size,
26 PlatformSensorProvider* provider);
27
28 ~PlatformSensorAmbientLightMac() override;
29 mojom::ReportingMode GetReportingMode() override;
30 void UpdateReading() override;
31
32 protected:
33 virtual bool StartSensor(
34 const PlatformSensorConfiguration& configuration) override;
35 virtual void StopSensor() override;
36 bool CheckSensorConfiguration(
37 const PlatformSensorConfiguration& configuration) override;
38 PlatformSensorConfiguration GetDefaultConfiguration() override;
39
40 private:
41 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
42 std::unique_ptr<content::AmbientLightSensor> platformSensor_;
43 DISALLOW_COPY_AND_ASSIGN(PlatformSensorAmbientLightMac);
44 };
45
46 } // namespace device
47
48 #endif // DEVICE_GENERIC_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698