Chromium Code Reviews| 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..9da8612b9a0be5b9eacdf6f06292bb82fe94c120 100644 |
| --- a/content/browser/device_orientation/provider.h |
| +++ b/content/browser/device_orientation/provider.h |
| @@ -6,23 +6,25 @@ |
| #define CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_H_ |
| #include "base/memory/ref_counted.h" |
| +#include "content/browser/device_orientation/device_data.h" |
| #include "content/common/content_export.h" |
| namespace device_orientation { |
| -class Orientation; |
| - |
| class CONTENT_EXPORT Provider : public base::RefCountedThreadSafe<Provider> { |
| public: |
| class Observer { |
| public: |
| - // Called when the orientation changes. |
| + // Called when device data changes. |
| // An Observer must not synchronously call Provider::RemoveObserver |
| // or Provider::AddObserver when this is called. |
| - virtual void OnOrientationUpdate(const Orientation& orientation) = 0; |
| + virtual void OnDeviceDataUpdate(const DeviceData* device_data) = 0; |
| + DeviceData::DeviceDataType device_data_type() { return device_data_type_; } |
| protected: |
| virtual ~Observer() {} |
| + // Each Observer observes exactly one type of DeviceData |
|
bulach
2012/07/12 10:43:27
nit: members must be private...
please, add a cons
aousterh
2012/07/12 17:13:57
Done (regarding the private members).
|
| + DeviceData::DeviceDataType device_data_type_; |
| }; |
| // Returns a pointer to the singleton instance of this class. |
| @@ -39,8 +41,7 @@ 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. |
| + // Note: AddObserver may call back synchronously to the observer with data. |
| virtual void AddObserver(Observer* observer) = 0; |
| virtual void RemoveObserver(Observer* observer) = 0; |