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

Side by Side Diff: chromeos/network/auto_connect_handler.cc

Issue 1461823002: Handle device ONC 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 unified diff | Download patch
« no previous file with comments | « no previous file | chromeos/network/auto_connect_handler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromeos/network/auto_connect_handler.h" 5 #include "chromeos/network/auto_connect_handler.h"
6 6
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 if (!global_network_config) 208 if (!global_network_config)
209 return; // Device policy is not set, yet. 209 return; // Device policy is not set, yet.
210 210
211 applied_autoconnect_policy_ = true; 211 applied_autoconnect_policy_ = true;
212 212
213 bool only_policy_autoconnect = false; 213 bool only_policy_autoconnect = false;
214 global_network_config->GetBooleanWithoutPathExpansion( 214 global_network_config->GetBooleanWithoutPathExpansion(
215 ::onc::global_network_config::kAllowOnlyPolicyNetworksToAutoconnect, 215 ::onc::global_network_config::kAllowOnlyPolicyNetworksToAutoconnect,
216 &only_policy_autoconnect); 216 &only_policy_autoconnect);
217 bool only_policy_connect = false;
218 global_network_config->GetBooleanWithoutPathExpansion(
219 ::onc::global_network_config::kAllowOnlyPolicyNetworksToConnect,
220 &only_policy_connect);
217 221
218 if (only_policy_autoconnect) 222 if (only_policy_autoconnect || only_policy_connect)
219 DisconnectFromUnmanagedSharedWiFiNetworks(); 223 DisconnectFromUnmanagedSharedWiFiNetworks();
220 } 224 }
221 225
222 void AutoConnectHandler::DisconnectFromUnmanagedSharedWiFiNetworks() { 226 void AutoConnectHandler::DisconnectFromUnmanagedSharedWiFiNetworks() {
223 NET_LOG_DEBUG("DisconnectFromUnmanagedSharedWiFiNetworks", ""); 227 NET_LOG_DEBUG("DisconnectFromUnmanagedSharedWiFiNetworks", "");
224 228
225 NetworkStateHandler::NetworkStateList networks; 229 NetworkStateHandler::NetworkStateList networks;
226 network_state_handler_->GetVisibleNetworkListByType( 230 network_state_handler_->GetVisibleNetworkListByType(
227 NetworkTypePattern::Wireless(), &networks); 231 NetworkTypePattern::Wireless(), &networks);
228 for (const NetworkState* network : networks) { 232 for (const NetworkState* network : networks) {
(...skipping 22 matching lines...) Expand all
251 void AutoConnectHandler::CallShillConnectToBestServices() const { 255 void AutoConnectHandler::CallShillConnectToBestServices() const {
252 NET_LOG_EVENT("ConnectToBestServices", ""); 256 NET_LOG_EVENT("ConnectToBestServices", "");
253 DBusThreadManager::Get()->GetShillManagerClient()->ConnectToBestServices( 257 DBusThreadManager::Get()->GetShillManagerClient()->ConnectToBestServices(
254 base::Bind(&base::DoNothing), 258 base::Bind(&base::DoNothing),
255 base::Bind(&network_handler::ShillErrorCallbackFunction, 259 base::Bind(&network_handler::ShillErrorCallbackFunction,
256 "ConnectToBestServices Failed", 260 "ConnectToBestServices Failed",
257 "", network_handler::ErrorCallback())); 261 "", network_handler::ErrorCallback()));
258 } 262 }
259 263
260 } // namespace chromeos 264 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/network/auto_connect_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698