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

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

Issue 2727953005: [MD settings] ignore-extensions to no-extension-indicator (Closed)
Patch Set: wrapped lines 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 | « chrome/browser/resources/settings/system_page/system_page.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 // 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 Behavior for policy controlled settings prefs. 6 * @fileoverview Behavior for policy controlled settings prefs.
7 */ 7 */
8 8
9 /** @polymerBehavior */ 9 /** @polymerBehavior */
10 var CrPolicyPrefBehavior = { 10 var CrPolicyPrefBehavior = {
11 properties: { 11 properties: {
12 /** 12 /**
13 * Showing that an extension is controlling a pref is sometimes done with a 13 * Showing that an extension is controlling a pref is sometimes done with a
14 * different UI (e.g. extension-controlled-indicator). In those cases, 14 * different UI (e.g. extension-controlled-indicator). In those cases,
15 * avoid showing an (extra) indicator here. 15 * avoid showing an (extra) indicator here.
16 * @public 16 * @public
17 */ 17 */
18 ignoreExtensions: Boolean, 18 noExtensionIndicator: Boolean,
19 }, 19 },
20 20
21 /** 21 /**
22 * Is the |pref| controlled by something that prevents user control of the 22 * Is the |pref| controlled by something that prevents user control of the
23 * preference. 23 * preference.
24 * @return {boolean} True if |this.pref| is controlled by an enforced policy. 24 * @return {boolean} True if |this.pref| is controlled by an enforced policy.
25 */ 25 */
26 isPrefEnforced: function() { 26 isPrefEnforced: function() {
27 if (this.ignoreExtensions &&
28 this.pref.controlledBy ==
29 chrome.settingsPrivate.ControlledBy.EXTENSION) {
30 return false;
31 }
32 return this.pref.enforcement == chrome.settingsPrivate.Enforcement.ENFORCED; 27 return this.pref.enforcement == chrome.settingsPrivate.Enforcement.ENFORCED;
33 }, 28 },
34 29
35 /** 30 /**
36 * @return {boolean} True if |this.pref| has a recommended or enforced policy. 31 * @return {boolean} True if |this.pref| has a recommended or enforced policy.
37 */ 32 */
38 hasPrefPolicyIndicator: function() { 33 hasPrefPolicyIndicator: function() {
34 if (this.noExtensionIndicator &&
35 this.pref.controlledBy ==
36 chrome.settingsPrivate.ControlledBy.EXTENSION) {
37 return false;
38 }
39 return this.isPrefEnforced() || 39 return this.isPrefEnforced() ||
40 this.pref.enforcement == chrome.settingsPrivate.Enforcement.RECOMMENDED; 40 this.pref.enforcement == chrome.settingsPrivate.Enforcement.RECOMMENDED;
41 }, 41 },
42 }; 42 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/system_page/system_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698