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

Side by Side Diff: ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js

Issue 2555373006: MD Settings: cr-policy-pref-indicator: Eliminate controllingUser (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1
michaelpg 2016/12/09 03:23:10 revert blank line
stevenjb 2016/12/09 16:51:47 Done.
1 // Copyright 2015 The Chromium Authors. All rights reserved. 2 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 4 // found in the LICENSE file.
4 5
5 /** 6 /**
6 * @fileoverview Polymer element for indicating policies that apply to an 7 * @fileoverview Polymer element for indicating policies that apply to an
7 * element controlling a settings preference. 8 * element controlling a settings preference.
8 */ 9 */
9 Polymer({ 10 Polymer({
10 is: 'cr-policy-pref-indicator', 11 is: 'cr-policy-pref-indicator',
11 12
12 behaviors: [CrPolicyIndicatorBehavior, CrPolicyPrefBehavior], 13 behaviors: [CrPolicyIndicatorBehavior, CrPolicyPrefBehavior],
13 14
14 properties: { 15 properties: {
15 /** 16 /**
16 * Optional preference object associated with the indicator. Initialized to 17 * Optional preference object associated with the indicator. Initialized to
17 * null so that computed functions will get called if this is never set. 18 * null so that computed functions will get called if this is never set.
18 * @type {?chrome.settingsPrivate.PrefObject} 19 * @type {!chrome.settingsPrivate.PrefObject|undefined}
19 */ 20 */
20 pref: {type: Object, value: null}, 21 pref: Object,
21
22 /**
23 * Optional email of the user controlling the setting when the setting does
24 * not correspond to a pref (Chrome OS only). Only used when pref is null.
25 * Initialized to '' so that computed functions will get called if this is
26 * never set. TODO(stevenjb/michaelpg): Create a separate indicator for
27 * non-pref (i.e. explicitly set) indicators (see language_detail_page).
28 */
29 controllingUser: {type: String, value: ''},
30 22
31 /** 23 /**
32 * Which indicator type to show (or NONE). 24 * Which indicator type to show (or NONE).
33 * @type {CrPolicyIndicatorType} 25 * @type {CrPolicyIndicatorType}
34 */ 26 */
35 indicatorType: { 27 indicatorType: {
36 type: String, 28 type: String,
37 value: CrPolicyIndicatorType.NONE, 29 value: CrPolicyIndicatorType.NONE,
38 computed: 'getIndicatorType(pref.controlledBy, pref.enforcement)', 30 computed: 'getIndicatorType(pref.controlledBy, pref.enforcement)',
39 }, 31 },
40 }, 32 },
41 33
42 /** 34 /**
43 * @param {CrPolicyIndicatorType} type 35 * @param {CrPolicyIndicatorType} type
44 * @param {?chrome.settingsPrivate.PrefObject} pref 36 * @param {!chrome.settingsPrivate.PrefObject} pref
45 * @return {string} The tooltip text for |type|. 37 * @return {string} The tooltip text for |type|.
46 * @private 38 * @private
47 */ 39 */
48 getTooltip_: function(type, pref, controllingUser) { 40 getTooltip_: function(type, pref) {
49 if (type == CrPolicyIndicatorType.RECOMMENDED) { 41 if (type == CrPolicyIndicatorType.RECOMMENDED) {
50 if (pref && pref.value == pref.recommendedValue) 42 if (pref && pref.value == pref.recommendedValue)
51 return this.i18n_('controlledSettingRecommendedMatches'); 43 return this.i18n_('controlledSettingRecommendedMatches');
52 return this.i18n_('controlledSettingRecommendedDiffers'); 44 return this.i18n_('controlledSettingRecommendedDiffers');
53 } 45 }
54 var name = pref ? pref.controlledByName : controllingUser; 46 return this.getPolicyIndicatorTooltip(type, pref.controlledByName || '');
55 return this.getPolicyIndicatorTooltip(type, name);
56 } 47 }
57 }); 48 });
OLDNEW
« no previous file with comments | « ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698