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

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

Issue 2233443002: MD Settings: implement metrics reporting checkbox on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@desktop-uma
Patch Set: remove 2 using Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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',
11 11
12 behaviors: [CrPolicyIndicatorBehavior, CrPolicyPrefBehavior], 12 behaviors: [CrPolicyIndicatorBehavior, CrPolicyPrefBehavior],
13 13
14 properties: { 14 properties: {
15 /** 15 /**
16 * Optional preference object associated with the indicator. Initialized to 16 * Optional preference object associated with the indicator. Initialized to
17 * null so that computed functions will get called if this is never set. 17 * null so that computed functions will get called if this is never set.
18 * @type {?chrome.settingsPrivate.PrefObject} 18 * @type {?chrome.settingsPrivate.PrefObject}
19 */ 19 */
20 pref: {type: Object, value: null}, 20 pref: {type: Object, value: null},
21 21
22 /** 22 /**
23 * Optional email of the user controlling the setting when the setting does 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. 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 25 * Initialized to '' so that computed functions will get called if this is
26 * never set. TODO(stevenjb/michaelpg): Create a separate indicator for 26 * never set. TODO(stevenjb/michaelpg): Create a separate indicator for
27 * non-pref (i.e. explicitly set) indicators (see languyage_detail_page). 27 * non-pref (i.e. explicitly set) indicators (see language_detail_page).
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,
(...skipping 10 matching lines...) Expand all
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.policySourceName : controllingUser;
55 return this.getPolicyIndicatorTooltip(type, name); 55 return this.getPolicyIndicatorTooltip(type, name);
56 } 56 }
57 }); 57 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698