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

Side by Side Diff: chrome/browser/resources/settings/system_page/system_page.js

Issue 2971163002: Add local protection setting to chrome://settings/system
Patch Set: linux-only Created 3 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Settings that affect how Chrome interacts with the underlying 6 * @fileoverview Settings that affect how Chrome interacts with the underlying
7 * operating system (i.e. network, background processes, hardware). 7 * operating system (i.e. network, background processes, hardware).
8 */ 8 */
9 9
10 Polymer({ 10 Polymer({
11 is: 'settings-system-page', 11 is: 'settings-system-page',
12 12
13 properties: { 13 properties: {
14 prefs: { 14 prefs: {
15 type: Object, 15 type: Object,
16 notify: true, 16 notify: true,
17 }, 17 },
18 18
19 /** @private */ 19 /** @private */
20 isProxyEnforcedByPolicy_: { 20 isProxyEnforcedByPolicy_: {
21 type: Boolean, 21 type: Boolean,
22 computed: 'computeIsProxyEnforcedByPolicy_(prefs.proxy.*)', 22 computed: 'computeIsProxyEnforcedByPolicy_(prefs.proxy.*)',
23 }, 23 },
24
25 hideProtection_: {
26 type: Boolean,
27 value: true,
28 },
29
30 /** @private {chrome.settingsPrivate.PrefObject} */
31 protectionPref_: {
32 type: Object,
33 }
34 },
35
36 /** @override */
37 ready: function() {
38 this.proxy_ = settings.SystemPageBrowserProxyImpl.getInstance();
39
40 this.hideProtection_ = this.proxy_.hideProtectionSetting();
41
42 this.protectionPref_ = {
43 key: '',
44 type: chrome.settingsPrivate.PrefType.BOOLEAN,
45 value: this.proxy_.protectionSetting(),
46 };
47 },
48
49 onProtectionChange_: function() {
50 var enabled = this.$.protectionControl.checked;
51 this.proxy_.setProtectionSetting(enabled);
24 }, 52 },
25 53
26 /** 54 /**
27 * @return {boolean} 55 * @return {boolean}
28 * @private 56 * @private
29 */ 57 */
30 computeIsProxyEnforcedByPolicy_: function() { 58 computeIsProxyEnforcedByPolicy_: function() {
31 var pref = this.get('prefs.proxy'); 59 var pref = this.get('prefs.proxy');
32 // TODO(dbeam): do types of policy other than USER apply on ChromeOS? 60 // TODO(dbeam): do types of policy other than USER apply on ChromeOS?
33 return pref.enforcement == chrome.settingsPrivate.Enforcement.ENFORCED && 61 return pref.enforcement == chrome.settingsPrivate.Enforcement.ENFORCED &&
(...skipping 25 matching lines...) Expand all
59 /** 87 /**
60 * @param {boolean} enabled Whether hardware acceleration is currently 88 * @param {boolean} enabled Whether hardware acceleration is currently
61 * enabled. 89 * enabled.
62 * @private 90 * @private
63 */ 91 */
64 shouldShowRestart_: function(enabled) { 92 shouldShowRestart_: function(enabled) {
65 var proxy = settings.SystemPageBrowserProxyImpl.getInstance(); 93 var proxy = settings.SystemPageBrowserProxyImpl.getInstance();
66 return enabled != proxy.wasHardwareAccelerationEnabledAtStartup(); 94 return enabled != proxy.wasHardwareAccelerationEnabledAtStartup();
67 }, 95 },
68 }); 96 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698