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

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

Issue 2624043002: Eliminate loadTimeData dependency from cr_elements/policy (Closed)
Patch Set: Show icons (just not tooltips) if CrPolicyStrings is not defiend Created 3 years, 11 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
« no previous file with comments | « ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.js ('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 // 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 19 matching lines...) Expand all
30 }, 30 },
31 }, 31 },
32 32
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 if (type == CrPolicyIndicatorType.RECOMMENDED) { 40 var matches = pref && pref.value == pref.recommendedValue;
41 if (pref && pref.value == pref.recommendedValue) 41 return this.getPolicyIndicatorTooltip(
42 return this.i18n_('controlledSettingRecommendedMatches'); 42 type, pref.controlledByName || '', matches);
43 return this.i18n_('controlledSettingRecommendedDiffers');
44 }
45 return this.getPolicyIndicatorTooltip(type, pref.controlledByName || '');
46 } 43 }
47 }); 44 });
OLDNEW
« no previous file with comments | « ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698