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

Unified Diff: chrome/browser/ui/webui/settings/protocol_handlers_handler.cc

Issue 2598893002: [MD settings] lighter weight initializer for protocol handler enabled messages (Closed)
Patch Set: Created 4 years 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/settings/protocol_handlers_handler.cc
diff --git a/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc b/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
index 2e9c467140353b24c3a7ced2f1d6e7c56bda7386..a6caac157d440742db10605a9f6cc2367674092c 100644
--- a/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
+++ b/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
@@ -43,6 +43,9 @@ void ProtocolHandlersHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("initializeProtocolHandlerList",
base::Bind(&ProtocolHandlersHandler::HandleInitializeList,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback("initializeProtocolHandlerUpdates",
+ base::Bind(&ProtocolHandlersHandler::HandleInitializeUpdates,
+ base::Unretained(this)));
web_ui()->RegisterMessageCallback("clearDefault",
base::Bind(&ProtocolHandlersHandler::HandleClearDefault,
base::Unretained(this)));
@@ -138,6 +141,12 @@ void ProtocolHandlersHandler::HandleInitializeList(
UpdateHandlerList();
}
+void ProtocolHandlersHandler::HandleInitializeUpdates(
+ const base::ListValue* args) {
+ AllowJavascript();
+ SendHandlersEnabledValue();
+}
+
void ProtocolHandlersHandler::SendHandlersEnabledValue() {
CallJavascriptFunction("cr.webUIListenerCallback",
base::StringValue("setHandlersEnabled"),

Powered by Google App Engine
This is Rietveld 408576698