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

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

Issue 2819383002: [CrOS Tether] Update NetworkState to include tether properties and integrate into NetworkStateHandl… (Closed)
Patch Set: stevenjb@ comment. Created 3 years, 8 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 Polymer element for displaying a summary of network states 6 * @fileoverview Polymer element for displaying a summary of network states
7 * by type: Ethernet, WiFi, Cellular, WiMAX, and VPN. 7 * by type: Ethernet, WiFi, Cellular, WiMAX, and VPN.
8 */ 8 */
9 9
10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */ 10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 var firstConnectedNetwork = null; 295 var firstConnectedNetwork = null;
296 networkStates.forEach(function(networkState) { 296 networkStates.forEach(function(networkState) {
297 var type = networkState.Type; 297 var type = networkState.Type;
298 if (!activeNetworkStatesByType.has(type)) { 298 if (!activeNetworkStatesByType.has(type)) {
299 activeNetworkStatesByType.set(type, networkState); 299 activeNetworkStatesByType.set(type, networkState);
300 if (!firstConnectedNetwork && networkState.Type != CrOnc.Type.VPN && 300 if (!firstConnectedNetwork && networkState.Type != CrOnc.Type.VPN &&
301 networkState.ConnectionState == CrOnc.ConnectionState.CONNECTED) { 301 networkState.ConnectionState == CrOnc.ConnectionState.CONNECTED) {
302 firstConnectedNetwork = networkState; 302 firstConnectedNetwork = networkState;
303 } 303 }
304 } 304 }
305 newNetworkStateLists[type].push(networkState); 305 if (newNetworkStateLists.hasOwnProperty(type)) {
306 newNetworkStateLists[type].push(networkState);
307 }
306 }, this); 308 }, this);
307 309
308 this.defaultNetwork = firstConnectedNetwork; 310 this.defaultNetwork = firstConnectedNetwork;
309 311
310 // Create a VPN entry in deviceStates if there are any VPN networks. 312 // Create a VPN entry in deviceStates if there are any VPN networks.
311 if (newNetworkStateLists.VPN && newNetworkStateLists.VPN.length > 0) { 313 if (newNetworkStateLists.VPN && newNetworkStateLists.VPN.length > 0) {
312 newDeviceStates.VPN = /** @type {DeviceStateProperties} */ ({ 314 newDeviceStates.VPN = /** @type {DeviceStateProperties} */ ({
313 Type: CrOnc.Type.VPN, 315 Type: CrOnc.Type.VPN,
314 State: chrome.networkingPrivate.DeviceStateType.ENABLED 316 State: chrome.networkingPrivate.DeviceStateType.ENABLED
315 }); 317 });
(...skipping 21 matching lines...) Expand all
337 newActiveNetworkStates.push(state); 339 newActiveNetworkStates.push(state);
338 this.activeNetworkIds_.add(state.GUID); 340 this.activeNetworkIds_.add(state.GUID);
339 } 341 }
340 342
341 this.deviceStates = newDeviceStates; 343 this.deviceStates = newDeviceStates;
342 this.networkStateLists_ = newNetworkStateLists; 344 this.networkStateLists_ = newNetworkStateLists;
343 // Set activeNetworkStates last to rebuild the dom-repeat. 345 // Set activeNetworkStates last to rebuild the dom-repeat.
344 this.activeNetworkStates_ = newActiveNetworkStates; 346 this.activeNetworkStates_ = newActiveNetworkStates;
345 }, 347 },
346 }); 348 });
OLDNEW
« no previous file with comments | « ash/system/network/network_list.cc ('k') | chromeos/components/tether/active_host_network_state_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698