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