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

Unified Diff: chrome/browser/ui/webui/invalidations_message_handler.h

Issue 159773006: [invalidations] Added table with registered objectsIds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about_invalidations_clean
Patch Set: Better OwnerName for PushMessage Created 6 years, 10 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: 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
James Hawkins 2014/02/13 00:54:47 I think 'messages' can fit on this line, but I'm e
mferreria_g 2014/02/13 01:05:52 Done.
+ // messages.
void UIReady(const base::ListValue* args);
private:
+ // Transform a set to a ListValue in order to be automatically
James Hawkins 2014/02/13 00:54:47 Transforms
mferreria_g 2014/02/13 01:05:52 Done.
+ // 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);
};

Powered by Google App Engine
This is Rietveld 408576698