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

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

Issue 2889073002: Settings: Internet page cleanup (Closed)
Patch Set: Created 3 years, 7 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-detail' is the settings subpage containing details 7 * 'settings-internet-detail' is the settings subpage containing details
8 * for a network. 8 * for a network.
9 */ 9 */
10 (function() { 10 (function() {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 proxyExpanded_: Boolean, 120 proxyExpanded_: Boolean,
121 121
122 /** 122 /**
123 * Object providing network type values for data binding. 123 * Object providing network type values for data binding.
124 * @const 124 * @const
125 * @private 125 * @private
126 */ 126 */
127 NetworkType_: { 127 NetworkType_: {
128 type: Object, 128 type: Object,
129 value: { 129 value: {
130 CELLULAR: CrOnc.Type.CELLULAR, 130 CELLULAR: CrOnc.Type.CELLULAR,
dschuyler 2017/05/18 18:20:10 Hmm, am I missing something in my searches -- it l
stevenjb 2017/05/18 19:06:05 I just happened to notice that these were wrong wh
131 ETHERNET: CrOnc.Type.ETHERNET, 131 ETHERNET: CrOnc.Type.ETHERNET,
132 TETHER: CrOnc.Type.TETHER, 132 TETHER: CrOnc.Type.TETHER,
133 VPN: CrOnc.Type.VPN, 133 VPN: CrOnc.Type.VPN,
134 WIFI: CrOnc.Type.WI_FI, 134 WI_FI: CrOnc.Type.WI_FI,
135 WIMAX: CrOnc.Type.WI_MAX, 135 WI_MAX: CrOnc.Type.WI_MAX,
136 }, 136 },
137 readOnly: true 137 readOnly: true
138 }, 138 },
139 }, 139 },
140 140
141 /** 141 /**
142 * Listener function for chrome.networkingPrivate.onNetworksChanged event. 142 * Listener function for chrome.networkingPrivate.onNetworksChanged event.
143 * @type {?function(!Array<string>)} 143 * @type {?function(!Array<string>)}
144 * @private 144 * @private
145 */ 145 */
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 Type: type, 210 Type: type,
211 ConnectionState: CrOnc.ConnectionState.NOT_CONNECTED, 211 ConnectionState: CrOnc.ConnectionState.NOT_CONNECTED,
212 Name: {Active: name}, 212 Name: {Active: name},
213 }; 213 };
214 this.didSetFocus_ = false; 214 this.didSetFocus_ = false;
215 this.getNetworkDetails_(); 215 this.getNetworkDetails_();
216 }, 216 },
217 217
218 /** @private */ 218 /** @private */
219 close_: function() { 219 close_: function() {
220 // Delay navigating until the next render frame to allow other subpages to 220 // Delay navigating to allow other subpages to load first.
221 // load first. 221 requestAnimationFrame(function() {
222 setTimeout(function() { 222 settings.navigateToPreviousRoute();
223 settings.navigateTo(settings.Route.INTERNET);
224 }); 223 });
225 }, 224 },
226 225
227 /** @private */ 226 /** @private */
228 networkPropertiesChanged_: function() { 227 networkPropertiesChanged_: function() {
229 if (!this.networkProperties) 228 if (!this.networkProperties)
230 return; 229 return;
231 230
232 // Update autoConnect if it has changed. Default value is false. 231 // Update autoConnect if it has changed. Default value is false.
233 var autoConnect = CrOnc.getAutoConnect(this.networkProperties); 232 var autoConnect = CrOnc.getAutoConnect(this.networkProperties);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 this.networkingPrivate.getState( 304 this.networkingPrivate.getState(
306 this.guid, this.getStateCallback_.bind(this)); 305 this.guid, this.getStateCallback_.bind(this));
307 } else { 306 } else {
308 this.networkingPrivate.getManagedProperties( 307 this.networkingPrivate.getManagedProperties(
309 this.guid, this.getPropertiesCallback_.bind(this)); 308 this.guid, this.getPropertiesCallback_.bind(this));
310 } 309 }
311 }, 310 },
312 311
313 /** 312 /**
314 * networkingPrivate.getProperties callback. 313 * networkingPrivate.getProperties callback.
315 * @param {CrOnc.NetworkProperties} properties The network properties. 314 * @param {!CrOnc.NetworkProperties} properties The network properties.
316 * @private 315 * @private
317 */ 316 */
318 getPropertiesCallback_: function(properties) { 317 getPropertiesCallback_: function(properties) {
319 if (chrome.runtime.lastError) { 318 if (chrome.runtime.lastError) {
320 var message = chrome.runtime.lastError.message; 319 var message = chrome.runtime.lastError.message;
321 if (message == 'Error.InvalidNetworkGuid') { 320 if (message == 'Error.InvalidNetworkGuid') {
322 console.error('Details page: GUID no longer exists: ' + this.guid); 321 console.error('Details page: GUID no longer exists: ' + this.guid);
323 } else { 322 } else {
324 console.error( 323 console.error(
325 'Unexpected networkingPrivate.getManagedProperties error: ' + 324 'Unexpected networkingPrivate.getManagedProperties error: ' +
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 */ 1017 */
1019 allPropertiesMatch_: function(curValue, newValue) { 1018 allPropertiesMatch_: function(curValue, newValue) {
1020 for (var key in newValue) { 1019 for (var key in newValue) {
1021 if (newValue[key] != curValue[key]) 1020 if (newValue[key] != curValue[key])
1022 return false; 1021 return false;
1023 } 1022 }
1024 return true; 1023 return true;
1025 } 1024 }
1026 }); 1025 });
1027 })(); 1026 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698