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

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

Issue 134443004: sync: Remove some WebUI debug functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address some comments Created 6 years, 11 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/sync_internals_message_handler.cc
diff --git a/chrome/browser/ui/webui/sync_internals_message_handler.cc b/chrome/browser/ui/webui/sync_internals_message_handler.cc
index 88d7e2904ad1125f7aefa6219a4bf299087ac344..aac13f0972d38d64a06dd7852c728b6c466767fa 100644
--- a/chrome/browser/ui/webui/sync_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/sync_internals_message_handler.cc
@@ -19,6 +19,7 @@
using syncer::JsArgList;
using syncer::JsEventDetails;
using syncer::JsReplyHandler;
+using syncer::ModelTypeSet;
using syncer::WeakHandle;
SyncInternalsMessageHandler::SyncInternalsMessageHandler()
@@ -44,13 +45,14 @@ void SyncInternalsMessageHandler::RegisterMessages() {
base::Bind(&SyncInternalsMessageHandler::OnGetAboutInfo,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "getListOfTypes",
+ base::Bind(&SyncInternalsMessageHandler::OnGetListOfKnownTypes,
Evan Stade 2014/01/14 17:32:57 nit: please make message string and function name
rlarocque 2014/01/14 20:59:39 Oops. My search and replace missed instances with
+ base::Unretained(this)));
+
RegisterJsControllerCallback("getNotificationState");
RegisterJsControllerCallback("getNotificationInfo");
- RegisterJsControllerCallback("getRootNodeDetails");
- RegisterJsControllerCallback("getNodeSummariesById");
- RegisterJsControllerCallback("getNodeDetailsById");
RegisterJsControllerCallback("getAllNodes");
- RegisterJsControllerCallback("getChildNodeIds");
RegisterJsControllerCallback("getClientServerTraffic");
}
@@ -63,6 +65,20 @@ void SyncInternalsMessageHandler::OnGetAboutInfo(const base::ListValue* args) {
*value);
}
+void SyncInternalsMessageHandler::OnGetListOfKnownTypes(
+ const base::ListValue* args) {
+ // TODO(rlarocque): We should DCHECK(!args) here.
Evan Stade 2014/01/14 17:32:57 so why don't you?
rlarocque 2014/01/14 20:59:39 See chrome_sync.js. It has a generic function def
Evan Stade 2014/01/14 22:07:52 all this info would be good to have in a crbug whi
rlarocque 2014/01/14 22:20:44 Done.
+ base::ListValue type_list;
+ ModelTypeSet protocol_types = syncer::ProtocolTypes();
+ for (ModelTypeSet::Iterator it = protocol_types.First();
+ it.Good(); it.Inc()) {
+ type_list.Append(new base::StringValue(ModelTypeToString(it.Get())));
+ }
+ web_ui()->CallJavascriptFunction(
+ "chrome.sync.getListOfTypes.handleReply",
+ type_list);
+}
+
void SyncInternalsMessageHandler::HandleJsReply(
const std::string& name, const JsArgList& args) {
DVLOG(1) << "Handling reply for " << name << " message"
« no previous file with comments | « chrome/browser/ui/webui/sync_internals_message_handler.h ('k') | chrome/browser/ui/webui/sync_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698