Index: content/renderer/device_sensors/device_orientation_event_pump.cc |
diff --git a/content/renderer/device_sensors/device_orientation_event_pump.cc b/content/renderer/device_sensors/device_orientation_event_pump.cc |
index ec159b08ead138bdeb33d646ebd28b5e85eb2d1a..3746b53e970e84fd8aa45df0fbba974e87578dc3 100644 |
--- a/content/renderer/device_sensors/device_orientation_event_pump.cc |
+++ b/content/renderer/device_sensors/device_orientation_event_pump.cc |
@@ -14,23 +14,13 @@ namespace content { |
const double DeviceOrientationEventPump::kOrientationThreshold = 0.1; |
-DeviceOrientationEventPump::DeviceOrientationEventPump() |
- : DeviceSensorEventPump(), listener_(0) { |
-} |
- |
-DeviceOrientationEventPump::DeviceOrientationEventPump(int pump_delay_millis) |
- : DeviceSensorEventPump(pump_delay_millis), listener_(0) { |
+DeviceOrientationEventPump::DeviceOrientationEventPump(RenderThread* thread) |
+ : DeviceSensorEventPump<blink::WebDeviceOrientationListener>(thread) { |
} |
DeviceOrientationEventPump::~DeviceOrientationEventPump() { |
} |
-bool DeviceOrientationEventPump::SetListener( |
- blink::WebDeviceOrientationListener* listener) { |
- listener_ = listener; |
- return listener_ ? RequestStart() : Stop(); |
-} |
- |
bool DeviceOrientationEventPump::OnControlMessageReceived( |
const IPC::Message& message) { |
bool handled = true; |
@@ -84,12 +74,19 @@ bool DeviceOrientationEventPump::InitializeReader( |
return reader_->Initialize(handle); |
} |
-bool DeviceOrientationEventPump::SendStartMessage() { |
- return RenderThread::Get()->Send(new DeviceOrientationHostMsg_StartPolling()); |
+void DeviceOrientationEventPump::SendStartMessage() { |
+ RenderThread::Get()->Send(new DeviceOrientationHostMsg_StartPolling()); |
} |
-bool DeviceOrientationEventPump::SendStopMessage() { |
- return RenderThread::Get()->Send(new DeviceOrientationHostMsg_StopPolling()); |
+void DeviceOrientationEventPump::SendStopMessage() { |
+ RenderThread::Get()->Send(new DeviceOrientationHostMsg_StopPolling()); |
+} |
+ |
+void DeviceOrientationEventPump::SendFakeDataForTesting(void* fake_data) { |
+ blink::WebDeviceOrientationData data = |
+ *static_cast<blink::WebDeviceOrientationData*>(fake_data); |
+ |
+ listener_->didChangeDeviceOrientation(data); |
} |
} // namespace content |