Update function names in BrowserContextKeyedServiceFactory::GetServiceForBrowserConte...
[chromium-blink-merge.git] / content / renderer / device_orientation_dispatcher.h
blob5ee3342ebf33cba55f68d44ac6b364665f2dcb8b
1 // Copyright (c) 2012 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.
5 #ifndef CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_
6 #define CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_
8 #include "third_party/WebKit/public/web/WebDeviceOrientationClient.h"
9 #include "third_party/WebKit/public/web/WebDeviceOrientation.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/renderer/render_view_observer.h"
14 struct DeviceOrientationMsg_Updated_Params;
16 namespace content {
17 class RenderViewImpl;
19 class DeviceOrientationDispatcher : public RenderViewObserver,
20 public WebKit::WebDeviceOrientationClient {
21 public:
22 explicit DeviceOrientationDispatcher(RenderViewImpl* render_view);
23 virtual ~DeviceOrientationDispatcher();
25 private:
26 // RenderView::Observer implementation.
27 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
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;
36 void OnDeviceOrientationUpdated(
37 const DeviceOrientationMsg_Updated_Params& p);
39 scoped_ptr<WebKit::WebDeviceOrientationController> controller_;
40 WebKit::WebDeviceOrientation last_orientation_;
41 bool started_;
44 } // namespace content
46 #endif // CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_