| 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 AmbientLightSensorReading_h | 5 #ifndef AmbientLightSensorReading_h |
| 6 #define AmbientLightSensorReading_h | 6 #define AmbientLightSensorReading_h |
| 7 | 7 |
| 8 #include "modules/sensor/AmbientLightSensorReadingInit.h" | 8 #include "modules/sensor/AmbientLightSensorReadingInit.h" |
| 9 #include "modules/sensor/SensorReading.h" | 9 #include "modules/sensor/SensorReading.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class AmbientLightSensorReading final : public SensorReading { | 13 class AmbientLightSensorReading final : public SensorReading { |
| 14 DEFINE_WRAPPERTYPEINFO(); | 14 DEFINE_WRAPPERTYPEINFO(); |
| 15 | 15 |
| 16 public: | 16 public: |
| 17 static AmbientLightSensorReading* create( | 17 static AmbientLightSensorReading* create( |
| 18 const AmbientLightSensorReadingInit& init) { | 18 const AmbientLightSensorReadingInit& init) { |
| 19 return new AmbientLightSensorReading(init); | 19 return new AmbientLightSensorReading(init); |
| 20 } | 20 } |
| 21 | 21 |
| 22 static AmbientLightSensorReading* create(SensorProxy* proxy) { | 22 static AmbientLightSensorReading* create(const device::SensorReading& data) { |
| 23 return new AmbientLightSensorReading(proxy); | 23 return new AmbientLightSensorReading(data); |
| 24 } | 24 } |
| 25 | 25 |
| 26 ~AmbientLightSensorReading() override; | 26 ~AmbientLightSensorReading() override; |
| 27 | 27 |
| 28 double illuminance() const; | 28 double illuminance() const; |
| 29 | 29 |
| 30 bool isReadingUpdated(const SensorProxy::Reading&) const override; | 30 bool isReadingUpdated(const device::SensorReading&) const override; |
| 31 | 31 |
| 32 DECLARE_VIRTUAL_TRACE(); | 32 DECLARE_VIRTUAL_TRACE(); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 explicit AmbientLightSensorReading(const AmbientLightSensorReadingInit&); | 35 explicit AmbientLightSensorReading(const AmbientLightSensorReadingInit&); |
| 36 explicit AmbientLightSensorReading(SensorProxy*); | 36 explicit AmbientLightSensorReading(const device::SensorReading&); |
| 37 | |
| 38 private: | |
| 39 AmbientLightSensorReadingInit mAmbientLightSensorReadingInit; | |
| 40 }; | 37 }; |
| 41 | 38 |
| 42 } // namepsace blink | 39 } // namepsace blink |
| 43 | 40 |
| 44 #endif // AmbientLightSensorReading_h | 41 #endif // AmbientLightSensorReading_h |
| OLD | NEW |