[email protected] | 0253a52 | 2012-06-08 10:38:18 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 230b7ef | 2011-03-16 22:30:19 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_ |
6 | #define CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_ | ||||
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 7 | |
[email protected] | 8bd0fe6 | 2011-01-17 06:44:37 | [diff] [blame] | 8 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationClient.h" |
[email protected] | 0253a52 | 2012-06-08 10:38:18 | [diff] [blame] | 9 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientation.h" |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 10 | |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 11 | #include "base/memory/scoped_ptr.h" |
[email protected] | 3a034ebb | 2011-10-03 19:19:44 | [diff] [blame] | 12 | #include "content/public/renderer/render_view_observer.h" |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 13 | |
[email protected] | e7c21b81 | 2011-03-19 18:03:30 | [diff] [blame] | 14 | struct DeviceOrientationMsg_Updated_Params; |
[email protected] | 939856a | 2010-08-24 20:29:02 | [diff] [blame] | 15 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 16 | namespace content { |
17 | class RenderViewImpl; | ||||
18 | |||||
19 | class DeviceOrientationDispatcher : public RenderViewObserver, | ||||
[email protected] | 676126f7 | 2011-01-15 00:03:51 | [diff] [blame] | 20 | public WebKit::WebDeviceOrientationClient { |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 21 | public: |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 22 | explicit DeviceOrientationDispatcher(RenderViewImpl* render_view); |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 23 | virtual ~DeviceOrientationDispatcher(); |
24 | |||||
[email protected] | 676126f7 | 2011-01-15 00:03:51 | [diff] [blame] | 25 | private: |
26 | // RenderView::Observer implementation. | ||||
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 27 | virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 28 | |
29 | // From WebKit::WebDeviceOrientationClient. | ||||
30 | virtual void setController( | ||||
31 | WebKit::WebDeviceOrientationController* controller); | ||||
32 | virtual void startUpdating(); | ||||
33 | virtual void stopUpdating(); | ||||
34 | virtual WebKit::WebDeviceOrientation lastOrientation() const; | ||||
35 | |||||
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 36 | void OnDeviceOrientationUpdated( |
[email protected] | e7c21b81 | 2011-03-19 18:03:30 | [diff] [blame] | 37 | const DeviceOrientationMsg_Updated_Params& p); |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 38 | |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 39 | scoped_ptr<WebKit::WebDeviceOrientationController> controller_; |
[email protected] | 0253a52 | 2012-06-08 10:38:18 | [diff] [blame] | 40 | WebKit::WebDeviceOrientation last_orientation_; |
[email protected] | 57ead35 | 2010-08-11 14:42:53 | [diff] [blame] | 41 | bool started_; |
42 | }; | ||||
43 | |||||
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 44 | } // namespace content |
45 | |||||
[email protected] | 230b7ef | 2011-03-16 22:30:19 | [diff] [blame] | 46 | #endif // CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_ |