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

Unified Diff: chromeos/network/network_connection_handler.cc

Issue 1465133002: only forbid unmanaged WiFi on AllowOnlyPolicyNetworksToConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « chromeos/network/network_connection_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_connection_handler.cc
diff --git a/chromeos/network/network_connection_handler.cc b/chromeos/network/network_connection_handler.cc
index 47c1f6be5bc0ed3bad3687954fe0adccff134eca..22026a19bdab9c484141faa397b800f68671fee8 100644
--- a/chromeos/network/network_connection_handler.cc
+++ b/chromeos/network/network_connection_handler.cc
@@ -287,7 +287,8 @@ void NetworkConnectionHandler::ConnectToNetwork(
// Connect immediately to 'connectable' networks.
// TODO(stevenjb): Shill needs to properly set Connectable for VPN.
if (network && network->connectable() && network->type() != shill::kTypeVPN) {
- if (IsNetworkProhibitedByPolicy(network->guid(), network->profile_path())) {
+ if (IsNetworkProhibitedByPolicy(network->type(), network->guid(),
+ network->profile_path())) {
ErrorCallbackForPendingRequest(service_path, kErrorUnmanagedNetwork);
return;
}
@@ -423,7 +424,7 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect(
const base::DictionaryValue* user_policy =
managed_configuration_handler_->FindPolicyByGuidAndProfile(guid, profile);
- if (IsNetworkProhibitedByPolicy(guid, profile)) {
+ if (IsNetworkProhibitedByPolicy(type, guid, profile)) {
ErrorCallbackForPendingRequest(service_path, kErrorUnmanagedNetwork);
return;
}
@@ -536,10 +537,13 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect(
}
bool NetworkConnectionHandler::IsNetworkProhibitedByPolicy(
+ const std::string& type,
const std::string& guid,
const std::string& profile_path) {
if (!logged_in_)
return false;
+ if (type != shill::kTypeWifi)
+ return false;
const base::DictionaryValue* global_network_config =
managed_configuration_handler_->GetGlobalConfigFromPolicy(
std::string() /* no username hash, device policy */);
« no previous file with comments | « chromeos/network/network_connection_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698