OLD | NEW |
---|---|
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 var activeNetworkStatesByType = | 275 var activeNetworkStatesByType = |
276 /** @type {!Map<string, !CrOnc.NetworkStateProperties>} */ (new Map); | 276 /** @type {!Map<string, !CrOnc.NetworkStateProperties>} */ (new Map); |
277 | 277 |
278 // Complete list of states by type. | 278 // Complete list of states by type. |
279 /** @type {!NetworkStateListObject} */ var newNetworkStateLists = { | 279 /** @type {!NetworkStateListObject} */ var newNetworkStateLists = { |
280 Ethernet: [], | 280 Ethernet: [], |
281 WiFi: [], | 281 WiFi: [], |
282 Cellular: [], | 282 Cellular: [], |
283 WiMAX: [], | 283 WiMAX: [], |
284 VPN: [], | 284 VPN: [], |
285 Tether: [], | |
stevenjb
2017/04/19 21:16:02
We shouldn't add this here until we use it.
Kyle Horimoto
2017/04/19 22:31:04
Without this change, the settings page has a JavaS
stevenjb
2017/04/19 22:37:34
What's the error? We should probably fix that inst
Kyle Horimoto
2017/04/19 23:08:59
Done.
| |
285 }; | 286 }; |
286 | 287 |
287 var firstConnectedNetwork = null; | 288 var firstConnectedNetwork = null; |
288 networkStates.forEach(function(networkState) { | 289 networkStates.forEach(function(networkState) { |
289 var type = networkState.Type; | 290 var type = networkState.Type; |
290 if (!activeNetworkStatesByType.has(type)) { | 291 if (!activeNetworkStatesByType.has(type)) { |
291 activeNetworkStatesByType.set(type, networkState); | 292 activeNetworkStatesByType.set(type, networkState); |
292 if (!firstConnectedNetwork && networkState.Type != CrOnc.Type.VPN && | 293 if (!firstConnectedNetwork && networkState.Type != CrOnc.Type.VPN && |
293 networkState.ConnectionState == CrOnc.ConnectionState.CONNECTED) { | 294 networkState.ConnectionState == CrOnc.ConnectionState.CONNECTED) { |
294 firstConnectedNetwork = networkState; | 295 firstConnectedNetwork = networkState; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 newActiveNetworkStates.push(state); | 330 newActiveNetworkStates.push(state); |
330 this.activeNetworkIds_.add(state.GUID); | 331 this.activeNetworkIds_.add(state.GUID); |
331 } | 332 } |
332 | 333 |
333 this.deviceStates = newDeviceStates; | 334 this.deviceStates = newDeviceStates; |
334 this.networkStateLists_ = newNetworkStateLists; | 335 this.networkStateLists_ = newNetworkStateLists; |
335 // Set activeNetworkStates last to rebuild the dom-repeat. | 336 // Set activeNetworkStates last to rebuild the dom-repeat. |
336 this.activeNetworkStates_ = newActiveNetworkStates; | 337 this.activeNetworkStates_ = newActiveNetworkStates; |
337 }, | 338 }, |
338 }); | 339 }); |
OLD | NEW |