OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tray_vpn.h" | 5 #include "ash/system/chromeos/network/tray_vpn.h" |
6 | 6 |
7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/chromeos/network/network_state_list_detailed_view.h" | 10 #include "ash/system/chromeos/network/network_state_list_detailed_view.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 void NetworkIconChanged() override { Update(); } | 71 void NetworkIconChanged() override { Update(); } |
72 | 72 |
73 private: | 73 private: |
74 void GetNetworkStateHandlerImageAndLabel(gfx::ImageSkia* image, | 74 void GetNetworkStateHandlerImageAndLabel(gfx::ImageSkia* image, |
75 base::string16* label, | 75 base::string16* label, |
76 bool* animating) { | 76 bool* animating) { |
77 NetworkStateHandler* handler = | 77 NetworkStateHandler* handler = |
78 NetworkHandler::Get()->network_state_handler(); | 78 NetworkHandler::Get()->network_state_handler(); |
79 const NetworkState* vpn = | 79 const NetworkState* vpn = |
80 handler->FirstNetworkByType(NetworkTypePattern::VPN()); | 80 handler->FirstNetworkByType(NetworkTypePattern::VPN()); |
81 if (!vpn || (vpn->connection_state() == shill::kStateIdle)) { | 81 if (!vpn || (!vpn->IsConnectedState() && !vpn->IsConnectingState())) { |
stevenjb
2015/01/14 17:57:26
This was incorrect if State = 'failure', 'offline'
| |
82 *image = ui::network_icon::GetImageForDisconnectedNetwork( | 82 *image = ui::network_icon::GetImageForDisconnectedNetwork( |
83 ui::network_icon::ICON_TYPE_DEFAULT_VIEW, shill::kTypeVPN); | 83 ui::network_icon::ICON_TYPE_DEFAULT_VIEW, shill::kTypeVPN); |
84 if (label) { | 84 if (label) { |
85 *label = | 85 *label = |
86 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VPN_DISCONNECTED); | 86 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VPN_DISCONNECTED); |
87 } | 87 } |
88 *animating = false; | 88 *animating = false; |
89 return; | 89 return; |
90 } | 90 } |
91 *animating = vpn->IsConnectingState(); | 91 *animating = vpn->IsConnectingState(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 } | 164 } |
165 | 165 |
166 void TrayVPN::NetworkStateChanged() { | 166 void TrayVPN::NetworkStateChanged() { |
167 if (default_) | 167 if (default_) |
168 default_->Update(); | 168 default_->Update(); |
169 if (detailed_) | 169 if (detailed_) |
170 detailed_->Update(); | 170 detailed_->Update(); |
171 } | 171 } |
172 | 172 |
173 } // namespace ash | 173 } // namespace ash |
OLD | NEW |