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

Side by Side Diff: content/renderer/device_motion_dispatcher.h

Issue 10827415: Chromium-side implementation of DeviceMotion. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test should set the kEnableDeviceMotion flag Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/device_motion_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef CONTENT_RENDERER_DEVICE_MOTION_DISPATCHER_H_
6 #define CONTENT_RENDERER_DEVICE_MOTION_DISPATCHER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "content/public/renderer/render_view_observer.h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebDeviceMotionData .h"
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebDeviceMotionDete ctor.h"
12
13 class RenderViewImpl;
14
15 namespace WebKit {
16 class WebDeviceMotionDetectorClient;
17 }
18
19 struct DeviceMotionMsg_Updated_Params;
20
21 class DeviceMotionDispatcher : public content::RenderViewObserver,
22 public WebKit::WebDeviceMotionDetector {
23 public:
24 explicit DeviceMotionDispatcher(RenderViewImpl* render_view);
25 virtual ~DeviceMotionDispatcher();
26
27 private:
28 // RenderView::Observer implementation.
29 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
30
31 // WebKit::WebDeviceMotionDetector implementation.
32 virtual void startUpdating(WebKit::WebDeviceMotionDetectorClient* client)
33 OVERRIDE;
34 virtual void stopUpdating() OVERRIDE;
35 virtual WebKit::WebDeviceMotionData lastMotion() const OVERRIDE;
36
37 void OnDeviceMotionUpdated(
38 const DeviceMotionMsg_Updated_Params& p);
39
40 scoped_ptr<WebKit::WebDeviceMotionDetectorClient> client_;
41 WebKit::WebDeviceMotionData last_motion_;
42 bool started_;
43 };
44
45 #endif // CONTENT_RENDERER_DEVICE_MOTION_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/device_motion_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698