| OLD | NEW |
| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 for (const NetworkState* network : networks) { | 234 for (const NetworkState* network : networks) { |
| 235 if (!(network->IsConnectingState() || network->IsConnectedState())) | 235 if (!(network->IsConnectingState() || network->IsConnectedState())) |
| 236 break; // Connected and connecting networks are listed first. | 236 break; // Connected and connecting networks are listed first. |
| 237 | 237 |
| 238 if (network->IsPrivate()) | 238 if (network->IsPrivate()) |
| 239 continue; | 239 continue; |
| 240 | 240 |
| 241 const bool network_is_policy_managed = | 241 const bool network_is_policy_managed = |
| 242 !network->profile_path().empty() && !network->guid().empty() && | 242 !network->profile_path().empty() && !network->guid().empty() && |
| 243 managed_configuration_handler_->FindPolicyByGuidAndProfile( | 243 managed_configuration_handler_->FindPolicyByGuidAndProfile( |
| 244 network->guid(), network->profile_path()); | 244 network->guid(), network->profile_path(), nullptr); |
| 245 if (network_is_policy_managed) | 245 if (network_is_policy_managed) |
| 246 continue; | 246 continue; |
| 247 | 247 |
| 248 NET_LOG_EVENT("Disconnect Forced by Policy", network->path()); | 248 NET_LOG_EVENT("Disconnect Forced by Policy", network->path()); |
| 249 DBusThreadManager::Get()->GetShillServiceClient()->Disconnect( | 249 DBusThreadManager::Get()->GetShillServiceClient()->Disconnect( |
| 250 dbus::ObjectPath(network->path()), base::Bind(&base::DoNothing), | 250 dbus::ObjectPath(network->path()), base::Bind(&base::DoNothing), |
| 251 base::Bind(&network_handler::ShillErrorCallbackFunction, | 251 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 252 "AutoConnectHandler.Disconnect failed", network->path(), | 252 "AutoConnectHandler.Disconnect failed", network->path(), |
| 253 network_handler::ErrorCallback())); | 253 network_handler::ErrorCallback())); |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 | 256 |
| 257 void AutoConnectHandler::CallShillConnectToBestServices() const { | 257 void AutoConnectHandler::CallShillConnectToBestServices() const { |
| 258 NET_LOG_EVENT("ConnectToBestServices", ""); | 258 NET_LOG_EVENT("ConnectToBestServices", ""); |
| 259 DBusThreadManager::Get()->GetShillManagerClient()->ConnectToBestServices( | 259 DBusThreadManager::Get()->GetShillManagerClient()->ConnectToBestServices( |
| 260 base::Bind(&base::DoNothing), | 260 base::Bind(&base::DoNothing), |
| 261 base::Bind(&network_handler::ShillErrorCallbackFunction, | 261 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 262 "ConnectToBestServices Failed", | 262 "ConnectToBestServices Failed", |
| 263 "", network_handler::ErrorCallback())); | 263 "", network_handler::ErrorCallback())); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace chromeos | 266 } // namespace chromeos |
| OLD | NEW |