| 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_controller.h" | 7 #include "ash/common/session/session_controller.h" |
| 8 #include "ash/common/system/chromeos/network/network_icon.h" | 8 #include "ash/common/system/chromeos/network/network_icon.h" |
| 9 #include "ash/common/system/chromeos/network/network_icon_animation.h" | 9 #include "ash/common/system/chromeos/network/network_icon_animation.h" |
| 10 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" | 10 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 public: | 38 public: |
| 39 explicit VpnDefaultView(SystemTrayItem* owner) : TrayItemMore(owner) {} | 39 explicit VpnDefaultView(SystemTrayItem* owner) : TrayItemMore(owner) {} |
| 40 | 40 |
| 41 ~VpnDefaultView() override { | 41 ~VpnDefaultView() override { |
| 42 network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this); | 42 network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this); |
| 43 } | 43 } |
| 44 | 44 |
| 45 static bool ShouldShow() { | 45 static bool ShouldShow() { |
| 46 // Show the VPN entry in the ash tray bubble if at least one third-party VPN | 46 // Show the VPN entry in the ash tray bubble if at least one third-party VPN |
| 47 // provider is installed. | 47 // provider is installed. |
| 48 if (WmShell::Get()->vpn_list()->HaveThirdPartyVPNProviders()) | 48 if (Shell::Get()->vpn_list()->HaveThirdPartyVPNProviders()) |
| 49 return true; | 49 return true; |
| 50 | 50 |
| 51 // Also show the VPN entry if at least one VPN network is configured. | 51 // Also show the VPN entry if at least one VPN network is configured. |
| 52 NetworkStateHandler* const handler = | 52 NetworkStateHandler* const handler = |
| 53 NetworkHandler::Get()->network_state_handler(); | 53 NetworkHandler::Get()->network_state_handler(); |
| 54 if (handler->FirstNetworkByType(NetworkTypePattern::VPN())) | 54 if (handler->FirstNetworkByType(NetworkTypePattern::VPN())) |
| 55 return true; | 55 return true; |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 | 58 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 void TrayVPN::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {} | 198 void TrayVPN::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {} |
| 199 | 199 |
| 200 void TrayVPN::NetworkStateChanged() { | 200 void TrayVPN::NetworkStateChanged() { |
| 201 if (default_) | 201 if (default_) |
| 202 default_->Update(); | 202 default_->Update(); |
| 203 if (detailed_) | 203 if (detailed_) |
| 204 detailed_->Update(); | 204 detailed_->Update(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace ash | 207 } // namespace ash |
| OLD | NEW |