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

Unified Diff: ash/system/network/network_list.cc

Issue 2861773003: chromeos: Fix crash when clicking on networking menu under mash (Closed)
Patch Set: review comments Created 3 years, 8 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/mus/window_manager_application.cc ('k') | ash/system/network/tray_network_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/network/network_list.cc
diff --git a/ash/system/network/network_list.cc b/ash/system/network/network_list.cc
index f882160deec00f5f2385c239b94d8873eac82340..623a22f2faa2c528c3ea44c584929fa5da0932c6 100644
--- a/ash/system/network/network_list.cc
+++ b/ash/system/network/network_list.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "ash/public/cpp/config.h"
#include "ash/shell.h"
#include "ash/shell_port.h"
#include "ash/strings/grit/ash_strings.h"
@@ -525,15 +526,19 @@ NetworkListView::UpdateNetworkListEntries() {
// Keep an index where the next child should be inserted.
int index = 0;
- bool show_connection_warning =
+ // Show a warning that the connection might be monitored if connected to a VPN
+ // or if the default network has a proxy installed.
+ const bool using_vpn =
!!NetworkHandler::Get()->network_state_handler()->ConnectedNetworkByType(
NetworkTypePattern::VPN());
- show_connection_warning =
- show_connection_warning || NetworkHandler::Get()
- ->ui_proxy_config_service()
- ->HasDefaultNetworkProxyConfigured();
-
- if (show_connection_warning) {
+ // TODO(jamescook): Eliminate the null check by creating UIProxyConfigService
+ // under mash. This will require the mojo pref service to work with prefs in
+ // Local State. http://crbug.com/718072
+ const bool using_proxy = NetworkHandler::Get()->ui_proxy_config_service() &&
+ NetworkHandler::Get()
+ ->ui_proxy_config_service()
+ ->HasDefaultNetworkProxyConfigured();
+ if (using_vpn || using_proxy) {
if (!connection_warning_)
connection_warning_ = CreateConnectionWarning();
PlaceViewAtIndex(connection_warning_, index++);
« no previous file with comments | « ash/mus/window_manager_application.cc ('k') | ash/system/network/tray_network_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698