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 17 matching lines...) Expand all Loading... |
28 */ | 28 */ |
29 controllingUser: {type: String, value: ''}, | 29 controllingUser: {type: String, value: ''}, |
30 | 30 |
31 /** | 31 /** |
32 * Which indicator type to show (or NONE). | 32 * Which indicator type to show (or NONE). |
33 * @type {CrPolicyIndicatorType} | 33 * @type {CrPolicyIndicatorType} |
34 */ | 34 */ |
35 indicatorType: { | 35 indicatorType: { |
36 type: String, | 36 type: String, |
37 value: CrPolicyIndicatorType.NONE, | 37 value: CrPolicyIndicatorType.NONE, |
38 computed: 'getIndicatorType(pref.policySource, pref.policyEnforcement)', | 38 computed: 'getIndicatorType(pref.controlledBy, pref.enforcement)', |
39 }, | 39 }, |
40 }, | 40 }, |
41 | 41 |
42 /** | 42 /** |
43 * @param {CrPolicyIndicatorType} type | 43 * @param {CrPolicyIndicatorType} type |
44 * @param {?chrome.settingsPrivate.PrefObject} pref | 44 * @param {?chrome.settingsPrivate.PrefObject} pref |
45 * @return {string} The tooltip text for |type|. | 45 * @return {string} The tooltip text for |type|. |
46 * @private | 46 * @private |
47 */ | 47 */ |
48 getTooltip_: function(type, pref, controllingUser) { | 48 getTooltip_: function(type, pref, controllingUser) { |
49 if (type == CrPolicyIndicatorType.RECOMMENDED) { | 49 if (type == CrPolicyIndicatorType.RECOMMENDED) { |
50 if (pref && pref.value == pref.recommendedValue) | 50 if (pref && pref.value == pref.recommendedValue) |
51 return this.i18n_('controlledSettingRecommendedMatches'); | 51 return this.i18n_('controlledSettingRecommendedMatches'); |
52 return this.i18n_('controlledSettingRecommendedDiffers'); | 52 return this.i18n_('controlledSettingRecommendedDiffers'); |
53 } | 53 } |
54 var name = pref ? pref.policySourceName : controllingUser; | 54 var name = pref ? pref.controlledByName : controllingUser; |
55 return this.getPolicyIndicatorTooltip(type, name); | 55 return this.getPolicyIndicatorTooltip(type, name); |
56 } | 56 } |
57 }); | 57 }); |
OLD | NEW |