OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 #include "content/renderer/device_sensors/device_orientation_absolute_event_pump
.h" | |
6 | |
7 #include "content/common/device_sensors/device_orientation_messages.h" | |
8 #include "content/public/renderer/render_thread.h" | |
9 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationListener.h" | |
10 | |
11 namespace content { | |
12 | |
13 DeviceOrientationAbsoluteEventPump::DeviceOrientationAbsoluteEventPump( | |
14 RenderThread* thread) : DeviceOrientationEventPump(thread) { | |
15 } | |
16 | |
17 DeviceOrientationAbsoluteEventPump::~DeviceOrientationAbsoluteEventPump() { | |
18 } | |
19 | |
20 bool DeviceOrientationAbsoluteEventPump::OnControlMessageReceived( | |
21 const IPC::Message& message) { | |
22 bool handled = true; | |
23 IPC_BEGIN_MESSAGE_MAP(DeviceOrientationAbsoluteEventPump, message) | |
24 IPC_MESSAGE_HANDLER(DeviceOrientationAbsoluteMsg_DidStartPolling, | |
25 OnDidStart) | |
26 IPC_MESSAGE_UNHANDLED(handled = false) | |
27 IPC_END_MESSAGE_MAP() | |
28 return handled; | |
29 } | |
30 | |
31 void DeviceOrientationAbsoluteEventPump::SendStartMessage() { | |
32 RenderThread::Get()->Send( | |
33 new DeviceOrientationAbsoluteHostMsg_StartPolling()); | |
34 } | |
35 | |
36 void DeviceOrientationAbsoluteEventPump::SendStopMessage() { | |
37 RenderThread::Get()->Send(new DeviceOrientationAbsoluteHostMsg_StopPolling()); | |
38 } | |
39 | |
40 } // namespace content | |
OLD | NEW |