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 AmbientLightSensor_h | 5 #ifndef AmbientLightSensor_h |
6 #define AmbientLightSensor_h | 6 #define AmbientLightSensor_h |
7 | 7 |
8 #include "modules/sensor/Sensor.h" | 8 #include "modules/sensor/Sensor.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class AmbientLightSensorReading; | |
13 | |
14 class AmbientLightSensor final : public Sensor { | 12 class AmbientLightSensor final : public Sensor { |
15 DEFINE_WRAPPERTYPEINFO(); | 13 DEFINE_WRAPPERTYPEINFO(); |
16 | 14 |
17 public: | 15 public: |
18 static AmbientLightSensor* create(ExecutionContext*, | 16 static AmbientLightSensor* create(ExecutionContext*, |
19 const SensorOptions&, | 17 const SensorOptions&, |
20 ExceptionState&); | 18 ExceptionState&); |
21 static AmbientLightSensor* create(ExecutionContext*, ExceptionState&); | 19 static AmbientLightSensor* create(ExecutionContext*, ExceptionState&); |
22 | 20 |
23 AmbientLightSensorReading* reading() const; | 21 double illuminance(bool& isNull) const; |
24 | 22 |
25 DECLARE_VIRTUAL_TRACE(); | 23 DECLARE_VIRTUAL_TRACE(); |
26 | 24 |
27 private: | 25 private: |
28 AmbientLightSensor(ExecutionContext*, const SensorOptions&, ExceptionState&); | 26 AmbientLightSensor(ExecutionContext*, const SensorOptions&, ExceptionState&); |
29 // Sensor overrides. | |
30 std::unique_ptr<SensorReadingFactory> createSensorReadingFactory() override; | |
31 }; | 27 }; |
32 | 28 |
33 } // namespace blink | 29 } // namespace blink |
34 | 30 |
35 #endif // AmbientLightSensor_h | 31 #endif // AmbientLightSensor_h |
OLD | NEW |