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 Sensor_h | 5 #ifndef Sensor_h |
6 #define Sensor_h | 6 #define Sensor_h |
7 | 7 |
8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "core/dom/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void stopListening(); | 95 void stopListening(); |
96 | 96 |
97 // Makes sensor reading refresh its values from the shared buffer. | 97 // Makes sensor reading refresh its values from the shared buffer. |
98 void pollForData(); | 98 void pollForData(); |
99 | 99 |
100 void updateState(SensorState newState); | 100 void updateState(SensorState newState); |
101 void reportError(); | 101 void reportError(); |
102 | 102 |
103 void updatePollingStatus(); | 103 void updatePollingStatus(); |
104 | 104 |
| 105 void notifySensorReadingChanged(); |
| 106 void notifyStateChanged(); |
| 107 |
105 private: | 108 private: |
106 Member<SensorReading> m_sensorReading; | 109 Member<SensorReading> m_sensorReading; |
107 SensorOptions m_sensorOptions; | 110 SensorOptions m_sensorOptions; |
108 device::mojom::blink::SensorType m_type; | 111 device::mojom::blink::SensorType m_type; |
109 SensorState m_state; | 112 SensorState m_state; |
110 Member<SensorProxy> m_sensorProxy; | 113 Member<SensorProxy> m_sensorProxy; |
111 std::unique_ptr<SensorPollingStrategy> m_polling; | 114 std::unique_ptr<SensorPollingStrategy> m_polling; |
112 SensorProxy::Reading m_storedData; | 115 SensorProxy::Reading m_storedData; |
113 SensorConfigurationPtr m_configuration; | 116 SensorConfigurationPtr m_configuration; |
114 }; | 117 }; |
115 | 118 |
116 } // namespace blink | 119 } // namespace blink |
117 | 120 |
118 #endif // Sensor_h | 121 #endif // Sensor_h |
OLD | NEW |