Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1824)

Unified Diff: chrome/renderer/device_orientation_dispatcher.h

Issue 2858049: Chromium plumbing for Device Orientation. (Closed)
Patch Set: Fixes after try bot runs Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/device_orientation_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/device_orientation_dispatcher.h
diff --git a/chrome/renderer/device_orientation_dispatcher.h b/chrome/renderer/device_orientation_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e7c76f3eb0521b9469f702dcf402b2796af62af
--- /dev/null
+++ b/chrome/renderer/device_orientation_dispatcher.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_
+#define CHROME_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_
+
+#include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClient.h"
+
+#include "chrome/common/render_messages.h"
+
+class RenderView;
+namespace IPC { class Message; }
+
+class DeviceOrientationDispatcher : public WebKit::WebDeviceOrientationClient {
+ public:
+ explicit DeviceOrientationDispatcher(RenderView* render_view);
+ virtual ~DeviceOrientationDispatcher();
+
+ bool OnMessageReceived(const IPC::Message& msg);
+
+ // From WebKit::WebDeviceOrientationClient.
+ virtual void setController(
+ WebKit::WebDeviceOrientationController* controller);
+ virtual void startUpdating();
+ virtual void stopUpdating();
+ virtual WebKit::WebDeviceOrientation lastOrientation() const;
+
+ private:
+ void OnDeviceOrientationUpdated(
+ const ViewMsg_DeviceOrientationUpdated_Params& p);
+
+ RenderView* render_view_;
+ scoped_ptr<WebKit::WebDeviceOrientationController> controller_;
+ scoped_ptr<ViewMsg_DeviceOrientationUpdated_Params> last_update_;
+ bool started_;
+};
+
+#endif // CHROME_RENDERER_DEVICE_ORIENTATION_DISPATCHER_H_
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/device_orientation_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698