| Index: chromeos/components/tether/wifi_hotspot_connector.cc
|
| diff --git a/chromeos/components/tether/wifi_hotspot_connector.cc b/chromeos/components/tether/wifi_hotspot_connector.cc
|
| index 1ec2bed728055bcd31cb540d956d6bf3eff788b9..ed078b28c3126fa7d1636cba9f604817030f2a3a 100644
|
| --- a/chromeos/components/tether/wifi_hotspot_connector.cc
|
| +++ b/chromeos/components/tether/wifi_hotspot_connector.cc
|
| @@ -21,8 +21,10 @@ namespace tether {
|
|
|
| WifiHotspotConnector::WifiHotspotConnector(
|
| NetworkStateHandler* network_state_handler,
|
| - NetworkConnect* network_connect)
|
| - : network_state_handler_(network_state_handler),
|
| + NetworkConnect* network_connect,
|
| + ActiveHost* active_host)
|
| + : active_host_(active_host),
|
| + network_state_handler_(network_state_handler),
|
| network_connect_(network_connect),
|
| timer_(base::MakeUnique<base::OneShotTimer>()),
|
| weak_ptr_factory_(this) {
|
| @@ -79,6 +81,22 @@ void WifiHotspotConnector::NetworkPropertiesUpdated(
|
|
|
| if (network->connectable()) {
|
| // If the network is now connectable, initiate a connection to it.
|
| + std::string tether_guid = active_host_->GetTetherNetworkGuid();
|
| + bool successful_association =
|
| + network_state_handler_->AssociateTetherNetworkStateWithWifiNetwork(
|
| + tether_guid, wifi_guid_);
|
| + if (successful_association) {
|
| + PA_LOG(INFO) << "Wifi network with ID " << wifi_guid_
|
| + << " is connectable. Tether network ID: \"" << tether_guid
|
| + << "\", Wi-Fi network ID: \"" << wifi_guid_ << "\"";
|
| + } else {
|
| + PA_LOG(INFO) << "Wifi network with ID " << wifi_guid_
|
| + << " is connectable, but failed to associate tether network "
|
| + "with ID \""
|
| + << tether_guid << "\" to Wi-Fi network with ID: \""
|
| + << wifi_guid_ << "\"";
|
| + }
|
| +
|
| network_connect_->ConnectToNetworkId(wifi_guid_);
|
| }
|
| }
|
|
|