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

Unified Diff: chrome/browser/resources/settings/controls/controlled_button.js

Issue 2611243002: MD Settings: fix policy indicator rendering bug in <controlled-button> (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/controls/controlled_button.js
diff --git a/chrome/browser/resources/settings/controls/controlled_button.js b/chrome/browser/resources/settings/controls/controlled_button.js
index ac4428f338322d6b5c40e0ba7060bb574b79d2af..a6609ed68c4e8bdb3973dcbdcee634306c3ee18a 100644
--- a/chrome/browser/resources/settings/controls/controlled_button.js
+++ b/chrome/browser/resources/settings/controls/controlled_button.js
@@ -5,7 +5,11 @@
Polymer({
is: 'controlled-button',
- behaviors: [CrPolicyPrefBehavior, PrefControlBehavior],
+ behaviors: [
+ CrPolicyIndicatorBehavior,
+ CrPolicyPrefBehavior,
+ PrefControlBehavior,
+ ],
properties: {
/** @private */
@@ -33,4 +37,16 @@ Polymer({
e.preventDefault();
e.stopPropagation();
},
+
+ /**
+ * @param {!chrome.settingsPrivate.PrefObject} pref
+ * @return {boolean} Whether to show a controlled by indicator.
+ * @private
+ */
+ showIndicator_: function(pref) {
+ if (!pref.controlledBy || !pref.enforcement)
+ return false;
+ var indicator = this.getIndicatorType(pref.controlledBy, pref.enforcement);
+ return this.isIndicatorVisible(indicator);
+ },
});

Powered by Google App Engine
This is Rietveld 408576698