blob: 39bc5f1044ffb0571131e4efa6546bd7794880cd [file] [log] [blame]
[email protected]0253a522012-06-08 10:38:181// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]57ead352010-08-11 14:42:532// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]230b7ef2011-03-16 22:30:195#ifndef CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_
6#define CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_
[email protected]57ead352010-08-11 14:42:537
[email protected]8bd0fe62011-01-17 06:44:378#include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationClient.h"
[email protected]0253a522012-06-08 10:38:189#include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientation.h"
[email protected]57ead352010-08-11 14:42:5310
[email protected]3b63f8f42011-03-28 01:54:1511#include "base/memory/scoped_ptr.h"
[email protected]3a034ebb2011-10-03 19:19:4412#include "content/public/renderer/render_view_observer.h"
[email protected]57ead352010-08-11 14:42:5313
[email protected]e7c21b812011-03-19 18:03:3014struct DeviceOrientationMsg_Updated_Params;
[email protected]939856a2010-08-24 20:29:0215
[email protected]e9ff79c2012-10-19 21:31:2616namespace content {
17class RenderViewImpl;
18
19class DeviceOrientationDispatcher : public RenderViewObserver,
[email protected]676126f72011-01-15 00:03:5120 public WebKit::WebDeviceOrientationClient {
[email protected]57ead352010-08-11 14:42:5321 public:
[email protected]310ebd6302011-10-10 19:06:2822 explicit DeviceOrientationDispatcher(RenderViewImpl* render_view);
[email protected]57ead352010-08-11 14:42:5323 virtual ~DeviceOrientationDispatcher();
24
[email protected]676126f72011-01-15 00:03:5125 private:
26 // RenderView::Observer implementation.
[email protected]edc64de2011-11-17 20:07:3827 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
[email protected]57ead352010-08-11 14:42:5328
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]57ead352010-08-11 14:42:5336 void OnDeviceOrientationUpdated(
[email protected]e7c21b812011-03-19 18:03:3037 const DeviceOrientationMsg_Updated_Params& p);
[email protected]57ead352010-08-11 14:42:5338
[email protected]57ead352010-08-11 14:42:5339 scoped_ptr<WebKit::WebDeviceOrientationController> controller_;
[email protected]0253a522012-06-08 10:38:1840 WebKit::WebDeviceOrientation last_orientation_;
[email protected]57ead352010-08-11 14:42:5341 bool started_;
42};
43
[email protected]e9ff79c2012-10-19 21:31:2644} // namespace content
45
[email protected]230b7ef2011-03-16 22:30:1946#endif // CONTENT_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_