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

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

Issue 2788853003: [MD settings] clickable toggle labels on category default toggles (Closed)
Patch Set: Created 3 years, 9 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/category_default_setting.js
diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.js b/chrome/browser/resources/settings/site_settings/category_default_setting.js
index 19eee8324cede74524de17c99763e4da7437755a..1183a7bdd0ccd3125db778964a12f51f0b1466e7 100644
--- a/chrome/browser/resources/settings/site_settings/category_default_setting.js
+++ b/chrome/browser/resources/settings/site_settings/category_default_setting.js
@@ -13,6 +13,25 @@ Polymer({
behaviors: [SiteSettingsBehavior, WebUIListenerBehavior],
properties: {
+ /**
+ * The second line (secondary) text to be shown next to the toggle.
+ */
+ optionDescription: String,
+
+ /* Labels for the toggle on/off positions. */
+ toggleOffLabel: String,
+ toggleOnLabel: String,
stevenjb 2017/03/31 23:28:15 Maybe move these above optionDescription and menti
dschuyler 2017/04/01 00:09:38 I didn't do exactly that. I've sorted the public a
+
+ /**
+ * The second line (secondary) text to be shown next to the toggle.
+ */
+ subOptionLabel: String,
+
+ /**
+ * The second line (secondary) text to be shown next to the toggle.
stevenjb 2017/03/31 23:28:15 All three of these have the same comment.
dschuyler 2017/04/01 00:09:38 Whoops, thanks!
+ */
+ subOptionDescription: String,
+
/** @private {chrome.settingsPrivate.PrefObject} */
controlParams_: {
type: Object,
@@ -30,10 +49,11 @@ Polymer({
},
/**
- * The description to be shown next to the slider.
+ * The label to be shown next to the toggle. This will be either
+ * toggleOffLabel or toggleOnLabel.
* @private
*/
- sliderDescription_: String,
+ optionLabel_: String,
/**
* Cookies and Flash settings have a sub-control that is used to mimic a
@@ -46,16 +66,6 @@ Polymer({
return /** @type {chrome.settingsPrivate.PrefObject} */({});
},
},
-
- /* Labels for the toggle on/off positions. */
- toggleOffLabel: String,
- toggleOnLabel: String,
-
- subOptionLabel: String,
- subOptionSecondary: {
- type: String,
- value: null, // Needs default value so binding fires upon initialization.
- },
},
observers: [
@@ -193,7 +203,7 @@ Polymer({
this.category).then(function(defaultValue) {
this.updateControlParams_(defaultValue);
- // Flash only shows ALLOW or BLOCK descriptions on the slider.
+ // Flash only shows ALLOW or BLOCK descriptions on the toggle.
var setting = defaultValue.setting;
if (this.category == settings.ContentSettingsTypes.PLUGINS &&
setting == settings.PermissionValues.IMPORTANT_CONTENT) {
@@ -204,7 +214,7 @@ Polymer({
setting = settings.PermissionValues.ALLOW;
}
var categoryEnabled = setting != settings.PermissionValues.BLOCK;
- this.sliderDescription_ =
+ this.optionLabel_ =
categoryEnabled ? this.toggleOnLabel : this.toggleOffLabel;
}.bind(this));
},
@@ -217,14 +227,4 @@ Polymer({
return this.category == settings.ContentSettingsTypes.POPUPS &&
loadTimeData.getBoolean('isGuest');
},
-
- /**
- * Returns classname to indicate secondary label exists.
- * @param {boolean} subOptionLabel
- * @return {string}
- * @private
- */
- subOptionClass_: function(subOptionLabel) {
- return subOptionLabel ? 'two-line' : '';
- }
});

Powered by Google App Engine
This is Rietveld 408576698