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

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

Issue 2708013003: [MD settings] show icon when content settings are controlled by an extension (Closed)
Patch Set: unit test fix Created 3 years, 9 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_pref_behavior.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 30 matching lines...) Expand all
41 * @param {!chrome.settingsPrivate.ControlledBy|undefined} controlledBy 41 * @param {!chrome.settingsPrivate.ControlledBy|undefined} controlledBy
42 * @param {!chrome.settingsPrivate.Enforcement|undefined} enforcement 42 * @param {!chrome.settingsPrivate.Enforcement|undefined} enforcement
43 * @return {CrPolicyIndicatorType} The indicator type based on |controlledBy| 43 * @return {CrPolicyIndicatorType} The indicator type based on |controlledBy|
44 * and |enforcement|. 44 * and |enforcement|.
45 */ 45 */
46 getIndicatorTypeForPref_: function(controlledBy, enforcement) { 46 getIndicatorTypeForPref_: function(controlledBy, enforcement) {
47 if (enforcement == chrome.settingsPrivate.Enforcement.RECOMMENDED) 47 if (enforcement == chrome.settingsPrivate.Enforcement.RECOMMENDED)
48 return CrPolicyIndicatorType.RECOMMENDED; 48 return CrPolicyIndicatorType.RECOMMENDED;
49 if (enforcement == chrome.settingsPrivate.Enforcement.ENFORCED) { 49 if (enforcement == chrome.settingsPrivate.Enforcement.ENFORCED) {
50 switch (controlledBy) { 50 switch (controlledBy) {
51 case chrome.settingsPrivate.ControlledBy.EXTENSION:
52 return CrPolicyIndicatorType.EXTENSION;
51 case chrome.settingsPrivate.ControlledBy.PRIMARY_USER: 53 case chrome.settingsPrivate.ControlledBy.PRIMARY_USER:
52 return CrPolicyIndicatorType.PRIMARY_USER; 54 return CrPolicyIndicatorType.PRIMARY_USER;
53 case chrome.settingsPrivate.ControlledBy.OWNER: 55 case chrome.settingsPrivate.ControlledBy.OWNER:
54 return CrPolicyIndicatorType.OWNER; 56 return CrPolicyIndicatorType.OWNER;
55 case chrome.settingsPrivate.ControlledBy.USER_POLICY: 57 case chrome.settingsPrivate.ControlledBy.USER_POLICY:
56 return CrPolicyIndicatorType.USER_POLICY; 58 return CrPolicyIndicatorType.USER_POLICY;
57 case chrome.settingsPrivate.ControlledBy.DEVICE_POLICY: 59 case chrome.settingsPrivate.ControlledBy.DEVICE_POLICY:
58 return CrPolicyIndicatorType.DEVICE_POLICY; 60 return CrPolicyIndicatorType.DEVICE_POLICY;
59 } 61 }
60 } 62 }
61 return CrPolicyIndicatorType.NONE; 63 return CrPolicyIndicatorType.NONE;
62 }, 64 },
63 65
64 /** 66 /**
65 * @param {CrPolicyIndicatorType} indicatorType 67 * @param {CrPolicyIndicatorType} indicatorType
66 * @return {string} The tooltip text for |indicatorType|. 68 * @return {string} The tooltip text for |indicatorType|.
67 * @private 69 * @private
68 */ 70 */
69 getIndicatorTooltipForPref_: function(indicatorType) { 71 getIndicatorTooltipForPref_: function(indicatorType) {
70 var matches = this.pref && this.pref.value == this.pref.recommendedValue; 72 var matches = this.pref && this.pref.value == this.pref.recommendedValue;
71 return this.getIndicatorTooltip( 73 return this.getIndicatorTooltip(
72 indicatorType, this.pref.controlledByName || '', matches); 74 indicatorType, this.pref.controlledByName || '', matches);
73 }, 75 },
74 }); 76 });
OLDNEW
« no previous file with comments | « ui/webui/resources/cr_elements/policy/cr_policy_pref_behavior.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698