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 AmbientLightSensorReading_h |
| 6 #define AmbientLightSensorReading_h |
| 7 |
| 8 #include "modules/sensor/SensorReading.h" |
| 9 #include "modules/sensor/als_reading.h" |
| 10 #include "platform/heap/Handle.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class MODULES_EXPORT AmbientLightSensorReading final : public SensorReading { |
| 15 DEFINE_WRAPPERTYPEINFO(); |
| 16 |
| 17 public: |
| 18 static AmbientLightSensorReading* create() |
| 19 { |
| 20 return new AmbientLightSensorReading; |
| 21 } |
| 22 |
| 23 static AmbientLightSensorReading* create(double timeStamp, double illuminana
ce) |
| 24 { |
| 25 return new AmbientLightSensorReading(timeStamp, illuminanace); |
| 26 } |
| 27 |
| 28 double illuminance() const { return m_illuminance; } |
| 29 double timeStamp() const { return SensorReading::timeStamp(); } |
| 30 |
| 31 void setIlluminance(double lux) { m_illuminance = lux; } |
| 32 |
| 33 virtual ~AmbientLightSensorReading(); |
| 34 |
| 35 DECLARE_VIRTUAL_TRACE(); |
| 36 |
| 37 AmbientLightSensorReading(); |
| 38 AmbientLightSensorReading(double timeStamp, double illuminanace); |
| 39 AmbientLightSensorReading(const AmbientLightSensorReading&) = default; |
| 40 |
| 41 private: |
| 42 double m_illuminance; |
| 43 }; |
| 44 |
| 45 } // namespace blink |
| 46 |
| 47 #endif // AmbientLightSensorReading_h |
OLD | NEW |