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

Unified Diff: chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js

Issue 2598893002: [MD settings] lighter weight initializer for protocol handler enabled messages (Closed)
Patch Set: review changes 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/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js b/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
index b510502f3d3b8d3c31bb95c674bb3e6a3cd2c649..05035f40bdf70bf049553735c518306191e68038 100644
--- a/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
+++ b/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
@@ -208,10 +208,23 @@ cr.define('settings', function() {
removeAllCookies: function() {},
/**
- * Initializes the protocol handler list. List is returned through JS calls
- * to setHandlersEnabled, setProtocolHandlers & setIgnoredProtocolHandlers.
+ * observes _all_ of the the protocol handler state, which includes a list
+ * that is returned through JS calls to 'setProtocolHandlers' along with
+ * other state sent with the messages 'setIgnoredProtocolHandler' and
+ * 'setHandlersEnabled'.
*/
- initializeProtocolHandlerList: function() {},
+ observeProtocolHandlers: function() {},
+
+ /**
+ * Observes one aspect of the protocol handler so that updates to the
+ * enabled/disabled state are sent. A 'setHandlersEnabled' will be sent
+ * from C++ immediately after receiving this observe request and updates
+ * may follow via additional 'setHandlersEnabled' messages.
+ *
+ * If |observeProtocolHandlers| is called, there's no need to call this
+ * observe as well.
+ */
+ observeProtocolHandlersEnabledState: function() {},
/**
* Enables or disables the ability for sites to ask to become the default
@@ -354,8 +367,14 @@ cr.define('settings', function() {
return cr.sendWithPromise('removeAllCookies');
},
- initializeProtocolHandlerList: function() {
- chrome.send('initializeProtocolHandlerList');
+ /** @override */
+ observeProtocolHandlers: function() {
+ chrome.send('observeProtocolHandlers');
+ },
+
+ /** @override */
+ observeProtocolHandlersEnabledState: function() {
+ chrome.send('observeProtocolHandlersEnabledState');
},
/** @override */

Powered by Google App Engine
This is Rietveld 408576698