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

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

Issue 159773006: [invalidations] Added table with registered objectsIds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about_invalidations_clean
Patch Set: 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.cc
diff --git a/chrome/browser/ui/webui/invalidations_message_handler.cc b/chrome/browser/ui/webui/invalidations_message_handler.cc
index 6a55ec56893dd1a5aa1edc5c9702df7a6ad788ad..fff3dfdb867c7cbf897089c4e1603a62cfb92a5c 100644
--- a/chrome/browser/ui/webui/invalidations_message_handler.cc
+++ b/chrome/browser/ui/webui/invalidations_message_handler.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/invalidation/invalidation_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/web_ui.h"
+#include "sync/notifier/invalidation_handler.h"
namespace invalidation {
class InvalidationLogger;
@@ -68,8 +69,13 @@ void InvalidationsMessageHandler::OnStateChange(
}
void InvalidationsMessageHandler::OnUpdateIds(
- const base::DictionaryValue& newIds) {}
-
+ std::string handlerName,
+ const syncer::ObjectIdSet& idsSet) {
+ scoped_ptr<base::ListValue> listOfObjects = ObjectIdSetToList(idsSet);
+ web_ui()->CallJavascriptFunction("chrome.invalidations.updateIds",
+ base::StringValue(handlerName),
+ *listOfObjects);
+}
void InvalidationsMessageHandler::OnDebugMessage(
const base::DictionaryValue& details) {}
@@ -79,3 +85,17 @@ void InvalidationsMessageHandler::OnInvalidation(
web_ui()->CallJavascriptFunction("chrome.invalidations.logInvalidations",
*invalidationsList);
}
+
+scoped_ptr<base::ListValue> InvalidationsMessageHandler::ObjectIdSetToList(
+ const syncer::ObjectIdSet& idsSet) {
+ scoped_ptr<base::ListValue> list(new base::ListValue());
+
+ for (syncer::ObjectIdSet::iterator it = idsSet.begin(); it != idsSet.end();
+ ++it) {
+ scoped_ptr<base::DictionaryValue> dic(new base::DictionaryValue);
+ dic->SetString("name", it->name());
+ dic->SetInteger("source", it->source());
+ list->Append(dic.release());
+ }
+ return list.Pass();
+}

Powered by Google App Engine
This is Rietveld 408576698