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 #include "modules/sensor/SensorProxy.h" | 5 #include "modules/sensor/SensorProxy.h" |
6 | 6 |
7 #include "core/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
8 #include "modules/sensor/SensorProviderProxy.h" | 8 #include "modules/sensor/SensorProviderProxy.h" |
9 #include "modules/sensor/SensorReading.h" | 9 #include "modules/sensor/SensorReading.h" |
10 #include "platform/mojo/MojoHelper.h" | 10 #include "platform/mojo/MojoHelper.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 for (Observer* observer : m_observers) | 140 for (Observer* observer : m_observers) |
141 observer->onSensorReadingChanged(); | 141 observer->onSensorReadingChanged(); |
142 } | 142 } |
143 | 143 |
144 void SensorProxy::RaiseError() { | 144 void SensorProxy::RaiseError() { |
145 handleSensorError(); | 145 handleSensorError(); |
146 } | 146 } |
147 | 147 |
148 void SensorProxy::SensorReadingChanged() { | 148 void SensorProxy::SensorReadingChanged() { |
| 149 DCHECK_EQ(ReportingMode::ON_CHANGE, m_mode); |
149 updateSensorReading(); | 150 updateSensorReading(); |
150 } | 151 } |
151 | 152 |
152 void SensorProxy::pageVisibilityChanged() { | 153 void SensorProxy::pageVisibilityChanged() { |
153 if (!isInitialized()) | 154 if (!isInitialized()) |
154 return; | 155 return; |
155 | 156 |
156 if (page()->visibilityState() != PageVisibilityStateVisible) { | 157 if (page()->visibilityState() != PageVisibilityStateVisible) { |
157 suspend(); | 158 suspend(); |
158 } else { | 159 } else { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 updateSensorReading(); | 294 updateSensorReading(); |
294 m_timer.startRepeating(repeatInterval, BLINK_FROM_HERE); | 295 m_timer.startRepeating(repeatInterval, BLINK_FROM_HERE); |
295 } | 296 } |
296 } | 297 } |
297 | 298 |
298 void SensorProxy::onTimerFired(TimerBase*) { | 299 void SensorProxy::onTimerFired(TimerBase*) { |
299 updateSensorReading(); | 300 updateSensorReading(); |
300 } | 301 } |
301 | 302 |
302 } // namespace blink | 303 } // namespace blink |
OLD | NEW |