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

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

Issue 10698046: Implements part of Device Motion in the Renderer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Resets last_motion_ 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
« 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 "third_party/WebKit/Source/Platform/chromium/public/WebDeviceMotionDete ctor.h"
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebDeviceMotionData .h"
10
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/renderer/render_view_observer.h"
13
14 class RenderViewImpl;
15
16 namespace WebKit {
17 class WebDeviceMotionDetectorClient;
18 }
19
20 struct DeviceMotionMsg_Updated_Params;
21
22 class DeviceMotionDispatcher : public content::RenderViewObserver,
23 public WebKit::WebDeviceMotionDetector {
24 public:
25 explicit DeviceMotionDispatcher(RenderViewImpl* render_view);
26 virtual ~DeviceMotionDispatcher();
27
28 private:
29 // RenderView::Observer implementation.
30 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
31
32 // WebKit::WebDeviceMotionDetector implementation.
33 virtual void startUpdating(WebKit::WebDeviceMotionDetectorClient* client)
34 OVERRIDE;
35 virtual void stopUpdating() OVERRIDE;
36 virtual WebKit::WebDeviceMotionData lastMotion() const OVERRIDE;
37
38 void OnDeviceMotionUpdated(
39 const DeviceMotionMsg_Updated_Params& p);
40
41 scoped_ptr<WebKit::WebDeviceMotionDetectorClient> client_;
42 WebKit::WebDeviceMotionData last_motion_;
43 bool started_;
44 };
45
46 #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