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

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: Fix closure 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..b90b0de1eb65270649e07c4835cc6dd04b6716c1 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
@@ -23,7 +23,7 @@ Polymer({
* Which indicator type to show (or NONE).
* @type {CrPolicyIndicatorType}
michaelpg 2017/02/15 02:02:11 @private?
stevenjb 2017/02/15 02:23:29 Done.
*/
- indicatorType: {
+ indicatorType_: {
type: String,
value: CrPolicyIndicatorType.NONE,
computed: 'getIndicatorType(pref.controlledBy, pref.enforcement)',
@@ -32,20 +32,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