| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Polymer element for indicating policies that apply to an | 6 * @fileoverview Polymer element for indicating policies that apply to an |
| 7 * element controlling a settings preference. | 7 * element controlling a settings preference. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'cr-policy-pref-indicator', | 10 is: 'cr-policy-pref-indicator', |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 /** | 33 /** |
| 34 * @param {CrPolicyIndicatorType} type | 34 * @param {CrPolicyIndicatorType} type |
| 35 * @param {!chrome.settingsPrivate.PrefObject} pref | 35 * @param {!chrome.settingsPrivate.PrefObject} pref |
| 36 * @return {string} The tooltip text for |type|. | 36 * @return {string} The tooltip text for |type|. |
| 37 * @private | 37 * @private |
| 38 */ | 38 */ |
| 39 getTooltip_: function(type, pref) { | 39 getTooltip_: function(type, pref) { |
| 40 var matches = pref && pref.value == pref.recommendedValue; | 40 var matches = pref && pref.value == pref.recommendedValue; |
| 41 return this.getPolicyIndicatorTooltip( | 41 return this.getPolicyIndicatorTooltip( |
| 42 type, pref.controlledByName || '', matches); | 42 type, pref.controlledByName || '', matches); |
| 43 } | 43 }, |
| 44 |
| 45 /** |
| 46 * @return {boolean} Whether the policy indicator is on. Useful for testing. |
| 47 */ |
| 48 isActive: function() { |
| 49 return this.isIndicatorVisible(this.indicatorType); |
| 50 }, |
| 44 }); | 51 }); |
| OLD | NEW |