| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 notify: true, | 48 notify: true, |
| 49 }, | 49 }, |
| 50 | 50 |
| 51 /** | 51 /** |
| 52 * Interface for networkingPrivate calls, passed from internet_page. | 52 * Interface for networkingPrivate calls, passed from internet_page. |
| 53 * @type {NetworkingPrivate} | 53 * @type {NetworkingPrivate} |
| 54 */ | 54 */ |
| 55 networkingPrivate: Object, | 55 networkingPrivate: Object, |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * The device state for each network device type. | 58 * The device state for each network device type. We initialize this to |
| 59 * include a disabled WiFi type since WiFi is always present. This reduces |
| 60 * the amount of visual change on first load. |
| 59 * @private {DeviceStateObject} | 61 * @private {DeviceStateObject} |
| 60 */ | 62 */ |
| 61 deviceStates: { | 63 deviceStates: { |
| 62 type: Object, | 64 type: Object, |
| 63 value: function() { | 65 value: function() { |
| 64 return {}; | 66 return { |
| 67 WiFi: { |
| 68 Type: chrome.networkingPrivate.NetworkType.WI_FI, |
| 69 State: chrome.networkingPrivate.DeviceStateType.DISABLED |
| 70 }, |
| 71 }; |
| 65 }, | 72 }, |
| 66 notify: true, | 73 notify: true, |
| 67 }, | 74 }, |
| 68 | 75 |
| 69 /** | 76 /** |
| 70 * Array of active network states, one per device type. | 77 * Array of active network states, one per device type. Initialized to |
| 78 * include a default WiFi state (see deviceStates comment). |
| 71 * @private {!Array<!CrOnc.NetworkStateProperties>} | 79 * @private {!Array<!CrOnc.NetworkStateProperties>} |
| 72 */ | 80 */ |
| 73 activeNetworkStates_: { | 81 activeNetworkStates_: { |
| 74 type: Array, | 82 type: Array, |
| 75 value: function() { | 83 value: function() { |
| 76 return []; | 84 return [{GUID: '', Type: chrome.networkingPrivate.NetworkType.WI_FI}]; |
| 77 }, | 85 }, |
| 78 }, | 86 }, |
| 79 | 87 |
| 80 /** | 88 /** |
| 81 * List of network state data for each network type. | 89 * List of network state data for each network type. |
| 82 * @private {NetworkStateListObject} | 90 * @private {NetworkStateListObject} |
| 83 */ | 91 */ |
| 84 networkStateLists_: { | 92 networkStateLists_: { |
| 85 type: Object, | 93 type: Object, |
| 86 value: function() { | 94 value: function() { |
| 87 return {}; | 95 return {WiFi: []}; |
| 88 }, | 96 }, |
| 89 }, | 97 }, |
| 90 }, | 98 }, |
| 91 | 99 |
| 92 /** | 100 /** |
| 93 * Listener function for chrome.networkingPrivate.onNetworkListChanged event. | 101 * Listener function for chrome.networkingPrivate.onNetworkListChanged event. |
| 94 * @type {?function(!Array<string>)} | 102 * @type {?function(!Array<string>)} |
| 95 * @private | 103 * @private |
| 96 */ | 104 */ |
| 97 networkListChangedListener_: null, | 105 networkListChangedListener_: null, |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 newActiveNetworkStates.push(state); | 337 newActiveNetworkStates.push(state); |
| 330 this.activeNetworkIds_.add(state.GUID); | 338 this.activeNetworkIds_.add(state.GUID); |
| 331 } | 339 } |
| 332 | 340 |
| 333 this.deviceStates = newDeviceStates; | 341 this.deviceStates = newDeviceStates; |
| 334 this.networkStateLists_ = newNetworkStateLists; | 342 this.networkStateLists_ = newNetworkStateLists; |
| 335 // Set activeNetworkStates last to rebuild the dom-repeat. | 343 // Set activeNetworkStates last to rebuild the dom-repeat. |
| 336 this.activeNetworkStates_ = newActiveNetworkStates; | 344 this.activeNetworkStates_ = newActiveNetworkStates; |
| 337 }, | 345 }, |
| 338 }); | 346 }); |
| OLD | NEW |