| 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/chromeos/network/vpn_list_view.h" | 5 #include "ash/system/chromeos/network/vpn_list_view.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 | 204 |
| 205 RemoveAllChildViews(true); | 205 RemoveAllChildViews(true); |
| 206 disconnect_button_ = nullptr; | 206 disconnect_button_ = nullptr; |
| 207 | 207 |
| 208 AddIconAndLabel(ui::network_icon::GetImageForNetwork( | 208 AddIconAndLabel(ui::network_icon::GetImageForNetwork( |
| 209 network, ui::network_icon::ICON_TYPE_LIST), | 209 network, ui::network_icon::ICON_TYPE_LIST), |
| 210 ui::network_icon::GetLabelForNetwork( | 210 ui::network_icon::GetLabelForNetwork( |
| 211 network, ui::network_icon::ICON_TYPE_LIST), | 211 network, ui::network_icon::ICON_TYPE_LIST), |
| 212 IsConnectedOrConnecting(network)); | 212 IsConnectedOrConnecting(network)); |
| 213 if (network->IsConnectedState()) { | 213 if (IsConnectedOrConnecting(network)) { |
| 214 disconnect_button_ = new DisconnectButton(this); | 214 disconnect_button_ = new DisconnectButton(this); |
| 215 AddChildView(disconnect_button_); | 215 AddChildView(disconnect_button_); |
| 216 SetBorder( | 216 SetBorder( |
| 217 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 3)); | 217 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 3)); |
| 218 } else { | 218 } else { |
| 219 SetBorder( | 219 SetBorder( |
| 220 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 0)); | 220 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 0)); |
| 221 } | 221 } |
| 222 | 222 |
| 223 // The icon and the disconnect button are always set to their preferred size. | 223 // The icon and the disconnect button are always set to their preferred size. |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 } | 414 } |
| 415 } | 415 } |
| 416 | 416 |
| 417 // Add providers without any configured networks, in the order that the | 417 // Add providers without any configured networks, in the order that the |
| 418 // providers were returned by the extensions system. | 418 // providers were returned by the extensions system. |
| 419 for (const VPNProvider& provider : providers) | 419 for (const VPNProvider& provider : providers) |
| 420 AddProviderAndNetworks(provider.key, provider.name, networks); | 420 AddProviderAndNetworks(provider.key, provider.name, networks); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace ash | 423 } // namespace ash |
| OLD | NEW |