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

Unified Diff: chrome/browser/resources/settings/site_settings_page/site_settings_page.js

Issue 2599913002: [MD settings] update protocol handler setting in content settings (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/site_settings_page/site_settings_page.js
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.js b/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
index 7ba95a55131f488c448f2d12f4f393ad166a6440..69701bf6cce10f83c60f14244e14a78ec611c81f 100644
--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
+++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
@@ -35,6 +35,7 @@ Polymer({
},
},
+ /** @override */
ready: function() {
this.ContentSettingsTypes = settings.ContentSettingsTypes;
this.ALL_SITES = settings.ALL_SITES;
@@ -52,6 +53,10 @@ Polymer({
this.addWebUIListener(
'contentSettingCategoryChanged',
this.updateDefaultValueLabel_.bind(this));
+ this.addWebUIListener(
+ 'setHandlersEnabled',
+ this.updateHandlersEnabled_.bind(this));
+ this.browserProxy.observeProtocolHandlersEnabledState();
},
/**
@@ -61,10 +66,8 @@ Polymer({
updateDefaultValueLabel_: function(category) {
this.browserProxy.getDefaultValueForContentType(
category).then(function(defaultValue) {
- var labelVar =
- 'default_.' + Polymer.CaseMap.dashToCamelCase(category);
this.set(
- labelVar,
+ 'default_.' + Polymer.CaseMap.dashToCamelCase(category),
this.computeCategoryDesc(
category,
defaultValue.setting,
@@ -73,6 +76,23 @@ Polymer({
},
/**
+ * The protocol handlers have a separate enabled/disabled notifier.
+ * @param {boolean} enabled
+ * @private
+ */
+ updateHandlersEnabled_: function(enabled) {
+ var category = settings.ContentSettingsTypes.PROTOCOL_HANDLERS;
+ this.set(
+ 'default_.' + Polymer.CaseMap.dashToCamelCase(category),
+ this.computeCategoryDesc(
+ category,
+ enabled ?
+ settings.PermissionValues.ALLOW :
+ settings.PermissionValues.BLOCK,
+ /*showRecommendation=*/false));
+ },
+
+ /**
* Navigate to the route specified in the event dataset.
* @param {!Event} event The tap event.
* @private
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698