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

Unified Diff: ash/system/chromeos/network/tray_vpn.cc

Issue 980943005: Add ash UI for third-party VPNs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_407541_434711_remove_combined_name
Patch Set: Updated after latest round of UI reviews. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/chromeos/network/tray_network.cc ('k') | ash/system/chromeos/network/vpn_list_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/network/tray_vpn.cc
diff --git a/ash/system/chromeos/network/tray_vpn.cc b/ash/system/chromeos/network/tray_vpn.cc
index 1ac509c2eb8e13620ade93192969c291c6b5ba93..36c55b7339e78e8975babd1c6e1d4299cdcce8b0 100644
--- a/ash/system/chromeos/network/tray_vpn.cc
+++ b/ash/system/chromeos/network/tray_vpn.cc
@@ -8,6 +8,7 @@
#include "ash/session/session_state_delegate.h"
#include "ash/shell.h"
#include "ash/system/chromeos/network/network_state_list_detailed_view.h"
+#include "ash/system/chromeos/network/vpn_delegate.h"
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_constants.h"
@@ -21,6 +22,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/chromeos/network/network_icon.h"
#include "ui/chromeos/network/network_icon_animation.h"
+#include "ui/chromeos/network/network_icon_animation_observer.h"
using chromeos::NetworkHandler;
using chromeos::NetworkState;
@@ -43,12 +45,21 @@ class VpnDefaultView : public TrayItemMore,
}
static bool ShouldShow() {
- // Do not show VPN line in uber tray bubble if VPN is not configured.
- NetworkStateHandler* handler =
+ // Show the VPN entry in the ash tray bubble if at least one third-party VPN
+ // provider is installed.
+ if (Shell::GetInstance()
+ ->system_tray_delegate()
+ ->GetVPNDelegate()
+ ->HaveThirdPartyVPNProviders()) {
+ return true;
+ }
+
+ // Also show the VPN entry if at least one VPN network is configured.
+ NetworkStateHandler* const handler =
NetworkHandler::Get()->network_state_handler();
- const NetworkState* vpn =
- handler->FirstNetworkByType(NetworkTypePattern::VPN());
- return vpn != NULL;
+ if (handler->FirstNetworkByType(NetworkTypePattern::VPN()))
+ return true;
+ return false;
}
void Update() {
« no previous file with comments | « ash/system/chromeos/network/tray_network.cc ('k') | ash/system/chromeos/network/vpn_list_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698