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

Unified Diff: content/browser/device_orientation/provider.h

Issue 10698046: Implements part of Device Motion in the Renderer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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
Index: content/browser/device_orientation/provider.h
diff --git a/content/browser/device_orientation/provider.h b/content/browser/device_orientation/provider.h
index 39ec86007db1ff891627086b72caa1e9fa8a463f..33e7f16c4d83fa57c40d43b1f402c3aa1cdb753e 100644
--- a/content/browser/device_orientation/provider.h
+++ b/content/browser/device_orientation/provider.h
@@ -10,11 +10,20 @@
namespace device_orientation {
+class Motion;
class Orientation;
class CONTENT_EXPORT Provider : public base::RefCountedThreadSafe<Provider> {
public:
- class Observer {
+ class MotionObserver {
+ public:
+ virtual void OnMotionUpdate(const Motion& motion) = 0;
+
+ protected:
+ virtual ~MotionObserver() {}
+ };
+
+ class OrientationObserver {
public:
// Called when the orientation changes.
// An Observer must not synchronously call Provider::RemoveObserver
@@ -22,7 +31,7 @@ class CONTENT_EXPORT Provider : public base::RefCountedThreadSafe<Provider> {
virtual void OnOrientationUpdate(const Orientation& orientation) = 0;
protected:
- virtual ~Observer() {}
+ virtual ~OrientationObserver() {}
};
// Returns a pointer to the singleton instance of this class.
@@ -39,10 +48,13 @@ class CONTENT_EXPORT Provider : public base::RefCountedThreadSafe<Provider> {
// Get the current instance. Used for testing.
static Provider* GetInstanceForTests();
- // Note: AddObserver may call back synchronously to the observer with
- // orientation data.
- virtual void AddObserver(Observer* observer) = 0;
- virtual void RemoveObserver(Observer* observer) = 0;
+ // Note: AddMotionObserver and AddOrientationObserver may call back
+ // synchronously to the observer with data.
+ virtual void AddMotionObserver(MotionObserver* observer) = 0;
+ virtual void AddOrientationObserver(OrientationObserver* observer) = 0;
+
+ virtual void RemoveMotionObserver(MotionObserver* observer) = 0;
+ virtual void RemoveOrientationObserver(OrientationObserver* observer) = 0;
protected:
Provider();

Powered by Google App Engine
This is Rietveld 408576698