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

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

Issue 2422453002: mutash: Convert ScreenShareTest/ScreenCaptureTest to AshTest (Closed)
Patch Set: rebase Created 4 years, 2 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/common/BUILD.gn ('k') | ash/common/system/chromeos/screen_security/screen_tray_item_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/network/tray_vpn.cc
diff --git a/ash/common/system/chromeos/network/tray_vpn.cc b/ash/common/system/chromeos/network/tray_vpn.cc
index 8d9ba35f3d830624be08213adf3bbd48ed63e4f4..53bba396aa49d77a3512e1992bc9160a2727c6b1 100644
--- a/ash/common/system/chromeos/network/tray_vpn.cc
+++ b/ash/common/system/chromeos/network/tray_vpn.cc
@@ -43,14 +43,16 @@ class VpnDefaultView : public TrayItemMore,
}
static bool ShouldShow() {
+ VPNDelegate* vpn_delegate =
+ WmShell::Get()->system_tray_delegate()->GetVPNDelegate();
+ // Tests may not have a VPN delegate. They should not show the VPN entry.
+ if (!vpn_delegate)
+ return false;
+
// Show the VPN entry in the ash tray bubble if at least one third-party VPN
// provider is installed.
- if (WmShell::Get()
- ->system_tray_delegate()
- ->GetVPNDelegate()
- ->HaveThirdPartyVPNProviders()) {
+ if (vpn_delegate->HaveThirdPartyVPNProviders())
return true;
- }
// Also show the VPN entry if at least one VPN network is configured.
NetworkStateHandler* const handler =
« no previous file with comments | « ash/common/BUILD.gn ('k') | ash/common/system/chromeos/screen_security/screen_tray_item_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698