| 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 #include "ash/system/network/vpn_list_view.h" | 5 #include "ash/system/network/vpn_list_view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 if (network && network->IsConnectingState()) | 187 if (network && network->IsConnectingState()) |
| 188 network_icon::NetworkIconAnimation::GetInstance()->AddObserver(this); | 188 network_icon::NetworkIconAnimation::GetInstance()->AddObserver(this); |
| 189 else | 189 else |
| 190 network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this); | 190 network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this); |
| 191 | 191 |
| 192 if (!network) { | 192 if (!network) { |
| 193 // This is a transient state where the network has been removed already but | 193 // This is a transient state where the network has been removed already but |
| 194 // the network list in the UI has not been updated yet. | 194 // the network list in the UI has not been updated yet. |
| 195 return; | 195 return; |
| 196 } | 196 } |
| 197 RemoveAllChildViews(true); | 197 Reset(); |
| 198 disconnect_button_ = nullptr; | 198 disconnect_button_ = nullptr; |
| 199 | 199 |
| 200 gfx::ImageSkia image = | 200 gfx::ImageSkia image = |
| 201 network_icon::GetImageForNetwork(network, network_icon::ICON_TYPE_LIST); | 201 network_icon::GetImageForNetwork(network, network_icon::ICON_TYPE_LIST); |
| 202 base::string16 label = network_icon::GetLabelForNetwork( | 202 base::string16 label = network_icon::GetLabelForNetwork( |
| 203 network, network_icon::ICON_TYPE_MENU_LIST); | 203 network, network_icon::ICON_TYPE_MENU_LIST); |
| 204 if (network->IsConnectedState()) | 204 if (network->IsConnectedState()) |
| 205 SetupConnectedItem(label, image); | 205 SetupConnectedItem(label, image); |
| 206 else if (network->IsConnectingState()) | 206 else if (network->IsConnectingState()) |
| 207 SetupConnectingItem(label, image); | 207 SetupConnectingItem(label, image); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 | 418 |
| 419 // Add providers without any configured networks, in the order that the | 419 // Add providers without any configured networks, in the order that the |
| 420 // providers were returned by the extensions system. | 420 // providers were returned by the extensions system. |
| 421 for (const VPNProvider& provider : providers) | 421 for (const VPNProvider& provider : providers) |
| 422 AddProviderAndNetworks(provider, networks); | 422 AddProviderAndNetworks(provider, networks); |
| 423 } | 423 } |
| 424 | 424 |
| 425 } // namespace ash | 425 } // namespace ash |
| OLD | NEW |