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

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: 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
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..601d9e304066ec234ab20229aa23a6052058c7df 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.
*/
+
tommycli 2017/01/27 00:36:52 nit: this was on purpose i assume?
dschuyler 2017/01/27 22:29:17 Acknowledged.
Polymer({
is: 'settings-site-settings-page',
@@ -60,6 +61,21 @@ Polymer({
},
/**
+ * @param {string} setting Value from settings.PermissionValues.
+ * @param {string} allow Non-block label ('feature X not allowed').
+ * @param {string} block Block label (likely just, 'Blocked').
+ * @param {?string} other Tristate value (maybe, 'session only').
+ * @private
+ */
+ defaultSettingLabel_: function(setting, allow, block, other) {
tommycli 2017/01/27 00:36:52 ALLOW and BLOCK have special meanings in content s
dschuyler 2017/01/27 22:29:17 I left of the String suffix since iirc, type decor
+ if (setting == settings.PermissionValues.BLOCK)
+ return block;
+ if (other === undefined || setting == settings.PermissionValues.ALLOW)
+ return allow;
+ return other;
tommycli 2017/01/27 00:36:52 A nitpick, but the (other === undefined || setting
dschuyler 2017/01/27 22:29:17 I left out the blank line because the whole group
+ },
+
+ /**
* @param {string} category The category to update.
* @private
*/
@@ -68,10 +84,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 +97,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);
},
/**

Powered by Google App Engine
This is Rietveld 408576698