Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: ash/system/chromeos/network/tray_vpn.cc

Issue 852803002: Correctly check VPN state in TrayVpn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_onc_crash
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698