| Index: chrome/browser/google_apis/drive_notification_manager.h
|
| diff --git a/chrome/browser/google_apis/drive_notification_manager.h b/chrome/browser/google_apis/drive_notification_manager.h
|
| index 3f1fc6e891fa96101557aa25696a9802abb48ed6..fdd9cc672cb187862805a54df3c1e98d4220bd3a 100644
|
| --- a/chrome/browser/google_apis/drive_notification_manager.h
|
| +++ b/chrome/browser/google_apis/drive_notification_manager.h
|
| @@ -8,6 +8,7 @@
|
| #include "base/observer_list.h"
|
| #include "chrome/browser/google_apis/drive_notification_observer.h"
|
| #include "chrome/browser/profiles/profile_keyed_service.h"
|
| +#include "sync/notifier/invalidation_handler.h"
|
|
|
| class Profile;
|
|
|
| @@ -20,7 +21,8 @@ namespace google_apis {
|
| // 2. Polling timer counts down.
|
| // TODO(calvinlo): Also add in backup timer.
|
| class DriveNotificationManager
|
| - : public ProfileKeyedService {
|
| + : public ProfileKeyedService,
|
| + public syncer::InvalidationHandler {
|
| public:
|
| explicit DriveNotificationManager(Profile* profile);
|
| virtual ~DriveNotificationManager();
|
| @@ -28,17 +30,32 @@ class DriveNotificationManager
|
| // ProfileKeyedService override.
|
| virtual void Shutdown() OVERRIDE;
|
|
|
| - // TODO(calvinlo): OVERRIDES for syncer::InvalidationHandler go here.
|
| + // syncer::InvalidationHandler implementation.
|
| + virtual void OnInvalidatorStateChange(
|
| + syncer::InvalidatorState state) OVERRIDE;
|
| + virtual void OnIncomingInvalidation(
|
| + const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE;
|
|
|
| void AddObserver(DriveNotificationObserver* observer);
|
| void RemoveObserver(DriveNotificationObserver* observer);
|
|
|
| private:
|
| void NotifyObserversToUpdate();
|
| + void RegisterDriveNotifications();
|
| + bool IsDriveNotificationSupported();
|
| + void SetPushNotificationEnabled(syncer::InvalidatorState state);
|
|
|
| Profile* profile_;
|
| ObserverList<DriveNotificationObserver> observers_;
|
|
|
| + // XMPP notification related variables.
|
| + // True when Drive File Sync Service is registered for Drive notifications.
|
| + bool push_notification_registered_;
|
| + // True once the first drive notification is received with OK state.
|
| + bool push_notification_enabled_;
|
| +
|
| + // TODO(calvinlo): Polling variables to go here.
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(DriveNotificationManager);
|
| };
|
|
|
|
|