OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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 #ifndef CHROME_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_ |
| 6 #define CHROME_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_ |
| 7 |
| 8 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClient.h
" |
| 9 |
| 10 #include "chrome/common/render_messages.h" |
| 11 |
| 12 class RenderView; |
| 13 namespace IPC { class Message; } |
| 14 |
| 15 class DeviceOrientationDispatcher : public WebKit::WebDeviceOrientationClient { |
| 16 public: |
| 17 explicit DeviceOrientationDispatcher(RenderView* render_view); |
| 18 virtual ~DeviceOrientationDispatcher(); |
| 19 |
| 20 bool OnMessageReceived(const IPC::Message& msg); |
| 21 |
| 22 // From WebKit::WebDeviceOrientationClient. |
| 23 virtual void setController( |
| 24 WebKit::WebDeviceOrientationController* controller); |
| 25 virtual void startUpdating(); |
| 26 virtual void stopUpdating(); |
| 27 virtual WebKit::WebDeviceOrientation lastOrientation() const; |
| 28 |
| 29 private: |
| 30 void OnDeviceOrientationUpdated( |
| 31 const ViewMsg_DeviceOrientationUpdated_Params& p); |
| 32 |
| 33 RenderView* render_view_; |
| 34 scoped_ptr<WebKit::WebDeviceOrientationController> controller_; |
| 35 scoped_ptr<ViewMsg_DeviceOrientationUpdated_Params> last_update_; |
| 36 bool started_; |
| 37 }; |
| 38 |
| 39 #endif // CHROME_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_ |
OLD | NEW |