| Index: chrome/browser/ui/webui/invalidations_message_handler.h
|
| diff --git a/chrome/browser/ui/webui/invalidations_message_handler.h b/chrome/browser/ui/webui/invalidations_message_handler.h
|
| index 41d60734fce3b56742064092a858d3277bd78599..690598d8b47d9e45d001f506ea20b3df9a493234 100644
|
| --- a/chrome/browser/ui/webui/invalidations_message_handler.h
|
| +++ b/chrome/browser/ui/webui/invalidations_message_handler.h
|
| @@ -10,6 +10,7 @@
|
| #include "base/values.h"
|
| #include "chrome/browser/invalidation/invalidation_logger_observer.h"
|
| #include "content/public/browser/web_ui_message_handler.h"
|
| +#include "sync/notifier/invalidation_util.h"
|
|
|
| class Profile;
|
|
|
| @@ -17,6 +18,10 @@ namespace invalidation {
|
| class InvalidationLogger;
|
| } // namespace invalidation
|
|
|
| +namespace syncer {
|
| +class InvalidationHandler;
|
| +} // namespace syncer
|
| +
|
| // The implementation for the chrome://invalidations page.
|
| class InvalidationsMessageHandler
|
| : public content::WebUIMessageHandler,
|
| @@ -25,28 +30,41 @@ class InvalidationsMessageHandler
|
| InvalidationsMessageHandler();
|
| virtual ~InvalidationsMessageHandler();
|
|
|
| - // Implementation of InvalidationLoggerObserver
|
| + // Implementation of InvalidationLoggerObserver.
|
| virtual void OnRegistration(const base::DictionaryValue& details) OVERRIDE;
|
| virtual void OnUnregistration(const base::DictionaryValue& details) OVERRIDE;
|
| - virtual void OnStateChange(const syncer::InvalidatorState& newState) OVERRIDE;
|
| - virtual void OnUpdateIds(const base::DictionaryValue& details) OVERRIDE;
|
| + virtual void OnStateChange(const syncer::InvalidatorState& new_state)
|
| + OVERRIDE;
|
| + virtual void OnUpdateIds(const std::string& handler_name,
|
| + const syncer::ObjectIdSet& ids_set) OVERRIDE;
|
| virtual void OnDebugMessage(const base::DictionaryValue& details) OVERRIDE;
|
| virtual void OnInvalidation(
|
| - const syncer::ObjectIdInvalidationMap& newInvalidations) OVERRIDE;
|
| + const syncer::ObjectIdInvalidationMap& new_invalidations) OVERRIDE;
|
|
|
| - // Implementation of WebUIMessageHandler
|
| + // Implementation of WebUIMessageHandler.
|
| virtual void RegisterMessages() OVERRIDE;
|
|
|
| + // Triggers the logger to send the current state and objects ids.
|
| void UpdateContent(const base::ListValue* args);
|
| +
|
| + // Called by the javascript whenever the page is ready to receive
|
| + // messages.
|
| void UIReady(const base::ListValue* args);
|
|
|
| private:
|
| + // Transform a set to a ListValue in order to be automatically
|
| + // transformed to a JavaScript array of objects.
|
| + scoped_ptr<base::ListValue> ObjectIdSetToList(
|
| + const syncer::ObjectIdSet& ids_set);
|
| +
|
| // The pointer to the internal InvalidatorService InvalidationLogger.
|
| // Used to get the information necessary to display to the JS and to
|
| // register ourselves as Observers for any notifications.
|
| invalidation::InvalidationLogger* logger_;
|
| - // Check to see if we are already registered as an observer
|
| - bool isRegistered;
|
| +
|
| + // Check to see if we are already registered as an observer.
|
| + bool is_registered_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(InvalidationsMessageHandler);
|
| };
|
|
|
|
|