| 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/common/system/chromeos/network/tray_vpn.h" | 5 #include "ash/common/system/chromeos/network/tray_vpn.h" |
| 6 | 6 |
| 7 #include "ash/common/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/system/chromeos/network/network_state_list_detailed_view.h" | 8 #include "ash/common/system/chromeos/network/network_state_list_detailed_view.h" |
| 9 #include "ash/common/system/chromeos/network/vpn_delegate.h" | 9 #include "ash/common/system/chromeos/network/vpn_delegate.h" |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 void GetNetworkStateHandlerImageAndLabel(gfx::ImageSkia* image, | 83 void GetNetworkStateHandlerImageAndLabel(gfx::ImageSkia* image, |
| 84 base::string16* label, | 84 base::string16* label, |
| 85 bool* animating) { | 85 bool* animating) { |
| 86 NetworkStateHandler* handler = | 86 NetworkStateHandler* handler = |
| 87 NetworkHandler::Get()->network_state_handler(); | 87 NetworkHandler::Get()->network_state_handler(); |
| 88 const NetworkState* vpn = | 88 const NetworkState* vpn = |
| 89 handler->FirstNetworkByType(NetworkTypePattern::VPN()); | 89 handler->FirstNetworkByType(NetworkTypePattern::VPN()); |
| 90 if (!vpn || (!vpn->IsConnectedState() && !vpn->IsConnectingState())) { | 90 if (!vpn || (!vpn->IsConnectedState() && !vpn->IsConnectingState())) { |
| 91 *image = ui::network_icon::GetImageForDisconnectedNetwork( | 91 *image = ui::network_icon::GetVpnImage(); |
| 92 ui::network_icon::ICON_TYPE_DEFAULT_VIEW, shill::kTypeVPN); | |
| 93 if (label) { | 92 if (label) { |
| 94 *label = | 93 *label = |
| 95 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VPN_DISCONNECTED); | 94 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VPN_DISCONNECTED); |
| 96 } | 95 } |
| 97 *animating = false; | 96 *animating = false; |
| 98 return; | 97 return; |
| 99 } | 98 } |
| 100 *animating = vpn->IsConnectingState(); | 99 *animating = vpn->IsConnectingState(); |
| 101 *image = ui::network_icon::GetImageForNetwork( | 100 *image = ui::network_icon::GetImageForNetwork( |
| 102 vpn, ui::network_icon::ICON_TYPE_DEFAULT_VIEW); | 101 vpn, ui::network_icon::ICON_TYPE_DEFAULT_VIEW); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 void TrayVPN::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {} | 168 void TrayVPN::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {} |
| 170 | 169 |
| 171 void TrayVPN::NetworkStateChanged() { | 170 void TrayVPN::NetworkStateChanged() { |
| 172 if (default_) | 171 if (default_) |
| 173 default_->Update(); | 172 default_->Update(); |
| 174 if (detailed_) | 173 if (detailed_) |
| 175 detailed_->Update(); | 174 detailed_->Update(); |
| 176 } | 175 } |
| 177 | 176 |
| 178 } // namespace ash | 177 } // namespace ash |
| OLD | NEW |