| 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 19 matching lines...) Expand all Loading... |
| 30 request_best_connection_pending_(false), | 30 request_best_connection_pending_(false), |
| 31 device_policy_applied_(false), | 31 device_policy_applied_(false), |
| 32 user_policy_applied_(false), | 32 user_policy_applied_(false), |
| 33 client_certs_resolved_(false), | 33 client_certs_resolved_(false), |
| 34 applied_autoconnect_policy_(false), | 34 applied_autoconnect_policy_(false), |
| 35 connect_to_best_services_after_scan_(false), | 35 connect_to_best_services_after_scan_(false), |
| 36 weak_ptr_factory_(this) { | 36 weak_ptr_factory_(this) { |
| 37 } | 37 } |
| 38 | 38 |
| 39 AutoConnectHandler::~AutoConnectHandler() { | 39 AutoConnectHandler::~AutoConnectHandler() { |
| 40 if (LoginState::IsInitialized()) |
| 41 LoginState::Get()->RemoveObserver(this); |
| 40 if (client_cert_resolver_) | 42 if (client_cert_resolver_) |
| 41 client_cert_resolver_->RemoveObserver(this); | 43 client_cert_resolver_->RemoveObserver(this); |
| 42 if (LoginState::IsInitialized()) | 44 if (network_connection_handler_) |
| 43 LoginState::Get()->RemoveObserver(this); | 45 network_connection_handler_->RemoveObserver(this); |
| 44 if (network_state_handler_) | 46 if (network_state_handler_) |
| 45 network_state_handler_->RemoveObserver(this, FROM_HERE); | 47 network_state_handler_->RemoveObserver(this, FROM_HERE); |
| 46 if (managed_configuration_handler_) | 48 if (managed_configuration_handler_) |
| 47 managed_configuration_handler_->RemoveObserver(this); | 49 managed_configuration_handler_->RemoveObserver(this); |
| 48 } | 50 } |
| 49 | 51 |
| 50 void AutoConnectHandler::Init( | 52 void AutoConnectHandler::Init( |
| 51 ClientCertResolver* client_cert_resolver, | 53 ClientCertResolver* client_cert_resolver, |
| 52 NetworkConnectionHandler* network_connection_handler, | 54 NetworkConnectionHandler* network_connection_handler, |
| 53 NetworkStateHandler* network_state_handler, | 55 NetworkStateHandler* network_state_handler, |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 void AutoConnectHandler::CallShillConnectToBestServices() const { | 257 void AutoConnectHandler::CallShillConnectToBestServices() const { |
| 256 NET_LOG_EVENT("ConnectToBestServices", ""); | 258 NET_LOG_EVENT("ConnectToBestServices", ""); |
| 257 DBusThreadManager::Get()->GetShillManagerClient()->ConnectToBestServices( | 259 DBusThreadManager::Get()->GetShillManagerClient()->ConnectToBestServices( |
| 258 base::Bind(&base::DoNothing), | 260 base::Bind(&base::DoNothing), |
| 259 base::Bind(&network_handler::ShillErrorCallbackFunction, | 261 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 260 "ConnectToBestServices Failed", | 262 "ConnectToBestServices Failed", |
| 261 "", network_handler::ErrorCallback())); | 263 "", network_handler::ErrorCallback())); |
| 262 } | 264 } |
| 263 | 265 |
| 264 } // namespace chromeos | 266 } // namespace chromeos |
| OLD | NEW |