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

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: Rebase 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..1f03b59c174757e44dc1d1b6a2c0351710329238 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,18 +45,19 @@ void SyncInternalsMessageHandler::RegisterMessages() {
base::Bind(&SyncInternalsMessageHandler::OnGetAboutInfo,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "getListOfTypes",
+ base::Bind(&SyncInternalsMessageHandler::OnGetListOfTypes,
+ base::Unretained(this)));
+
RegisterJsControllerCallback("getNotificationState");
RegisterJsControllerCallback("getNotificationInfo");
- RegisterJsControllerCallback("getRootNodeDetails");
- RegisterJsControllerCallback("getNodeSummariesById");
- RegisterJsControllerCallback("getNodeDetailsById");
RegisterJsControllerCallback("getAllNodes");
- RegisterJsControllerCallback("getChildNodeIds");
RegisterJsControllerCallback("getClientServerTraffic");
}
void SyncInternalsMessageHandler::OnGetAboutInfo(const base::ListValue* args) {
- // TODO(rlarocque): We should DCHECK(!args) here.
+ // TODO(rlarocque): We should DCHECK(!args) here. See crbug.com/334431.
scoped_ptr<base::DictionaryValue> value =
sync_ui_util::ConstructAboutInformation(GetProfileSyncService());
web_ui()->CallJavascriptFunction(
@@ -63,6 +65,20 @@ void SyncInternalsMessageHandler::OnGetAboutInfo(const base::ListValue* args) {
*value);
}
+void SyncInternalsMessageHandler::OnGetListOfTypes(
+ const base::ListValue* args) {
+ // TODO(rlarocque): We should DCHECK(!args) here. See crbug.com/334431.
+ 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