| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 /** | 154 /** |
| 155 * Event triggered when the network-summary-item is expanded. | 155 * Event triggered when the network-summary-item is expanded. |
| 156 * @param {!{detail: {expanded: boolean, type: string}}} event | 156 * @param {!{detail: {expanded: boolean, type: string}}} event |
| 157 * @private | 157 * @private |
| 158 */ | 158 */ |
| 159 onExpanded_: function(event) { | 159 onExpanded_: function(event) { |
| 160 if (!event.detail.expanded) | 160 if (!event.detail.expanded) |
| 161 return; | 161 return; |
| 162 // Get the latest network states. | 162 // Get the latest network states. |
| 163 this.getNetworkStates_(); | 163 this.getNetworkStates_(); |
| 164 if (event.detail.type == CrOnc.Type.WI_FI) | |
| 165 this.networkingPrivate.requestNetworkScan(); | |
| 166 }, | 164 }, |
| 167 | 165 |
| 168 /** | 166 /** |
| 169 * Event triggered when a network-summary-item is selected. | 167 * Event triggered when a network-summary-item is selected. |
| 170 * @param {!{detail: !CrOnc.NetworkStateProperties}} event | 168 * @param {!{detail: !CrOnc.NetworkStateProperties}} event |
| 171 * @private | 169 * @private |
| 172 */ | 170 */ |
| 173 onSelected_: function(event) { | 171 onSelected_: function(event) { |
| 174 var state = event.detail; | 172 var state = event.detail; |
| 175 if (this.canConnect_(state, this.globalPolicy)) { | 173 if (this.canConnect_(state, this.globalPolicy)) { |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 newActiveNetworkStates.push(state); | 407 newActiveNetworkStates.push(state); |
| 410 this.activeNetworkIds_.add(state.GUID); | 408 this.activeNetworkIds_.add(state.GUID); |
| 411 } | 409 } |
| 412 | 410 |
| 413 this.deviceStates_ = newDeviceStates; | 411 this.deviceStates_ = newDeviceStates; |
| 414 this.networkStateLists_ = newNetworkStateLists; | 412 this.networkStateLists_ = newNetworkStateLists; |
| 415 // Set activeNetworkStates last to rebuild the dom-repeat. | 413 // Set activeNetworkStates last to rebuild the dom-repeat. |
| 416 this.activeNetworkStates_ = newActiveNetworkStates; | 414 this.activeNetworkStates_ = newActiveNetworkStates; |
| 417 }, | 415 }, |
| 418 }); | 416 }); |
| OLD | NEW |