| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_RENDERER_DEVICE_MOTION_EVENT_PUMP_H_ | 5 #ifndef CONTENT_RENDERER_DEVICE_MOTION_EVENT_PUMP_H_ |
| 6 #define CONTENT_RENDERER_DEVICE_MOTION_EVENT_PUMP_H_ | 6 #define CONTENT_RENDERER_DEVICE_MOTION_EVENT_PUMP_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/renderer/device_orientation/device_sensor_event_pump.h" | 9 #include "content/renderer/device_orientation/device_sensor_event_pump.h" |
| 10 #include "content/renderer/shared_memory_seqlock_reader.h" | 10 #include "content/renderer/shared_memory_seqlock_reader.h" |
| 11 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h" | 11 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h" |
| 12 | 12 |
| 13 namespace WebKit { | 13 namespace blink { |
| 14 class WebDeviceMotionListener; | 14 class WebDeviceMotionListener; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 typedef SharedMemorySeqLockReader<WebKit::WebDeviceMotionData> | 19 typedef SharedMemorySeqLockReader<blink::WebDeviceMotionData> |
| 20 DeviceMotionSharedMemoryReader; | 20 DeviceMotionSharedMemoryReader; |
| 21 | 21 |
| 22 class CONTENT_EXPORT DeviceMotionEventPump : public DeviceSensorEventPump { | 22 class CONTENT_EXPORT DeviceMotionEventPump : public DeviceSensorEventPump { |
| 23 public: | 23 public: |
| 24 DeviceMotionEventPump(); | 24 DeviceMotionEventPump(); |
| 25 explicit DeviceMotionEventPump(int pump_delay_millis); | 25 explicit DeviceMotionEventPump(int pump_delay_millis); |
| 26 virtual ~DeviceMotionEventPump(); | 26 virtual ~DeviceMotionEventPump(); |
| 27 | 27 |
| 28 // Sets the listener to receive updates for device motion data at | 28 // Sets the listener to receive updates for device motion data at |
| 29 // regular intervals. Returns true if the registration was successful. | 29 // regular intervals. Returns true if the registration was successful. |
| 30 bool SetListener(WebKit::WebDeviceMotionListener* listener); | 30 bool SetListener(blink::WebDeviceMotionListener* listener); |
| 31 | 31 |
| 32 // RenderProcessObserver implementation. | 32 // RenderProcessObserver implementation. |
| 33 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 33 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 virtual void FireEvent() OVERRIDE; | 36 virtual void FireEvent() OVERRIDE; |
| 37 virtual bool InitializeReader(base::SharedMemoryHandle handle) OVERRIDE; | 37 virtual bool InitializeReader(base::SharedMemoryHandle handle) OVERRIDE; |
| 38 virtual bool SendStartMessage() OVERRIDE; | 38 virtual bool SendStartMessage() OVERRIDE; |
| 39 virtual bool SendStopMessage() OVERRIDE; | 39 virtual bool SendStopMessage() OVERRIDE; |
| 40 | 40 |
| 41 WebKit::WebDeviceMotionListener* listener_; | 41 blink::WebDeviceMotionListener* listener_; |
| 42 scoped_ptr<DeviceMotionSharedMemoryReader> reader_; | 42 scoped_ptr<DeviceMotionSharedMemoryReader> reader_; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace content | 45 } // namespace content |
| 46 | 46 |
| 47 #endif // CONTENT_RENDERER_DEVICE_MOTION_EVENT_PUMP_H_ | 47 #endif // CONTENT_RENDERER_DEVICE_MOTION_EVENT_PUMP_H_ |
| OLD | NEW |