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

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

Issue 2624573002: MD Settings: Internet: UI For global policy (Closed)
Patch Set: Rebase + Wrap 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
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 6 * @fileoverview
7 * 'settings-internet-page' is the settings page containing internet 7 * 'settings-internet-page' is the settings page containing internet
8 * settings. 8 * settings.
9 */ 9 */
10 Polymer({ 10 Polymer({
(...skipping 25 matching lines...) Expand all
36 36
37 /** 37 /**
38 * Whether the 'Add connection' section is expanded. 38 * Whether the 'Add connection' section is expanded.
39 * @private 39 * @private
40 */ 40 */
41 addConnectionExpanded_: { 41 addConnectionExpanded_: {
42 type: Boolean, 42 type: Boolean,
43 value: false, 43 value: false,
44 }, 44 },
45 45
46 /** @private {!chrome.networkingPrivate.GlobalPolicy|undefined} */
47 globalPolicy_: Object,
48
46 /** 49 /**
47 * List of third party VPN providers. 50 * List of third party VPN providers.
48 * @type {!Array<!chrome.networkingPrivate.ThirdPartyVPNProperties>} 51 * @type {!Array<!chrome.networkingPrivate.ThirdPartyVPNProperties>}
49 * @private 52 * @private
50 */ 53 */
51 thirdPartyVpnProviders_: { 54 thirdPartyVpnProviders_: {
52 type: Array, 55 type: Array,
53 value: function() { 56 value: function() {
54 return []; 57 return [];
55 } 58 }
(...skipping 10 matching lines...) Expand all
66 this.boundOnExtensionRemoved_ = this.boundOnExtensionRemoved_ || 69 this.boundOnExtensionRemoved_ = this.boundOnExtensionRemoved_ ||
67 this.onExtensionRemoved_.bind(this); 70 this.onExtensionRemoved_.bind(this);
68 chrome.management.onUninstalled.addListener( 71 chrome.management.onUninstalled.addListener(
69 this.boundOnExtensionRemoved_); 72 this.boundOnExtensionRemoved_);
70 73
71 this.boundOnExtensionDisabled_ = this.boundOnExtensionDisabled_ || 74 this.boundOnExtensionDisabled_ = this.boundOnExtensionDisabled_ ||
72 this.onExtensionDisabled_.bind(this); 75 this.onExtensionDisabled_.bind(this);
73 chrome.management.onDisabled.addListener(this.boundOnExtensionDisabled_); 76 chrome.management.onDisabled.addListener(this.boundOnExtensionDisabled_);
74 77
75 chrome.management.getAll(this.onGetAllExtensions_.bind(this)); 78 chrome.management.getAll(this.onGetAllExtensions_.bind(this));
79
80 this.networkingPrivate.getGlobalPolicy(function(policy) {
81 this.globalPolicy_ = policy;
82 }.bind(this));
76 }, 83 },
77 84
78 /** @override */ 85 /** @override */
79 detached: function() { 86 detached: function() {
80 chrome.management.onInstalled.removeListener( 87 chrome.management.onInstalled.removeListener(
81 assert(this.boundOnExtensionAdded_)); 88 assert(this.boundOnExtensionAdded_));
82 chrome.management.onEnabled.removeListener( 89 chrome.management.onEnabled.removeListener(
83 assert(this.boundOnExtensionAdded_)); 90 assert(this.boundOnExtensionAdded_));
84 chrome.management.onUninstalled.removeListener( 91 chrome.management.onUninstalled.removeListener(
85 assert(this.boundOnExtensionRemoved_)); 92 assert(this.boundOnExtensionRemoved_));
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 /** 226 /**
220 * chrome.management.onDisabled event. 227 * chrome.management.onDisabled event.
221 * @param {{id: string}} extension 228 * @param {{id: string}} extension
222 * @private 229 * @private
223 */ 230 */
224 onExtensionDisabled_: function(extension) { 231 onExtensionDisabled_: function(extension) {
225 this.onExtensionRemoved_(extension.id); 232 this.onExtensionRemoved_(extension.id);
226 }, 233 },
227 234
228 /** 235 /**
236 * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
237 * @return {boolean}
238 */
239 allowAddConnection_(globalPolicy) {
240 return !globalPolicy.AllowOnlyPolicyNetworksToConnect;
241 },
242
243 /**
229 * @param {!chrome.networkingPrivate.ThirdPartyVPNProperties} provider 244 * @param {!chrome.networkingPrivate.ThirdPartyVPNProperties} provider
230 * @return {string} 245 * @return {string}
231 */ 246 */
232 getAddThirdParrtyVpnLabel_: function(provider) { 247 getAddThirdParrtyVpnLabel_: function(provider) {
233 return this.i18n('internetAddThirdPartyVPN', provider.ProviderName); 248 return this.i18n('internetAddThirdPartyVPN', provider.ProviderName);
234 } 249 }
235 }); 250 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698