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

Unified Diff: ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js

Issue 2624003003: WebUI: Add cr-policy-pref-indicator tests (Closed)
Patch Set: Feedback Created 3 years, 10 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: ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
diff --git a/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js b/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
index 5526eb54d0eaef62e5056b4c1d63994bf6a4478b..37487ec7d98cbe3a077a6a1e6d934014e76521ee 100644
--- a/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
+++ b/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
@@ -22,8 +22,9 @@ Polymer({
/**
* Which indicator type to show (or NONE).
* @type {CrPolicyIndicatorType}
+ * @private
*/
- indicatorType: {
+ indicatorType_: {
type: String,
value: CrPolicyIndicatorType.NONE,
computed: 'getIndicatorType(pref.controlledBy, pref.enforcement)',
@@ -32,20 +33,19 @@ Polymer({
/**
* @param {CrPolicyIndicatorType} type
- * @param {!chrome.settingsPrivate.PrefObject} pref
* @return {string} The tooltip text for |type|.
* @private
*/
- getTooltip_: function(type, pref) {
- var matches = pref && pref.value == pref.recommendedValue;
+ getTooltip_: function(type) {
+ var matches = !!this.pref && this.pref.value == this.pref.recommendedValue;
return this.getPolicyIndicatorTooltip(
- type, pref.controlledByName || '', matches);
+ type, this.pref.controlledByName || '', matches);
},
/**
* @return {boolean} Whether the policy indicator is on. Useful for testing.
*/
isActive: function() {
- return this.isIndicatorVisible(this.indicatorType);
+ return this.isIndicatorVisible(this.indicatorType_);
},
});

Powered by Google App Engine
This is Rietveld 408576698