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(); |