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

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

Issue 2659833002: [MD settings] Data driven content setting subtext (Closed)
Patch Set: unit tests Created 3 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
« no previous file with comments | « chrome/browser/resources/settings/site_settings_page/site_settings_page.html ('k') | chrome/test/BUILD.gn » ('j') | 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 69701bf6cce10f83c60f14244e14a78ec611c81f..e3be214bb30f51fa3e1749e31452bb8314f3ea63 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
@@ -7,6 +7,7 @@
* 'settings-site-settings-page' is the settings page containing privacy and
* security site settings.
*/
+
Polymer({
is: 'settings-site-settings-page',
@@ -14,7 +15,7 @@ Polymer({
properties: {
/**
- * An object to bind default value labels to (so they are not in the |this|
+ * An object to bind default values to (so they are not in the |this|
* scope). The keys of this object are the values of the
* settings.ContentSettingsTypes enum.
* @private
@@ -60,6 +61,23 @@ Polymer({
},
/**
+ * @param {string} setting Value from settings.PermissionValues.
+ * @param {string} enabled Non-block label ('feature X not allowed').
+ * @param {string} disabled Block label (likely just, 'Blocked').
+ * @param {?string} other Tristate value (maybe, 'session only').
+ * @private
+ */
+ defaultSettingLabel_: function(setting, enabled, disabled, other) {
+ if (setting == settings.PermissionValues.BLOCK)
+ return disabled;
+ if (setting == settings.PermissionValues.ALLOW)
+ return enabled;
+ if (other)
+ return other;
+ return enabled;
+ },
+
+ /**
* @param {string} category The category to update.
* @private
*/
@@ -68,10 +86,7 @@ Polymer({
category).then(function(defaultValue) {
this.set(
'default_.' + Polymer.CaseMap.dashToCamelCase(category),
- this.computeCategoryDesc(
- category,
- defaultValue.setting,
- /*showRecommendation=*/false));
+ defaultValue.setting);
}.bind(this));
},
@@ -84,12 +99,9 @@ Polymer({
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));
+ enabled ?
+ settings.PermissionValues.ALLOW :
+ settings.PermissionValues.BLOCK);
},
/**
« no previous file with comments | « chrome/browser/resources/settings/site_settings_page/site_settings_page.html ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698