Chromium Code Reviews| 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..aab09eaeeaa7dda0b14d8aac8d4f320d5a5935cb 100644 |
| --- a/chromeos/components/tether/wifi_hotspot_connector.cc |
| +++ b/chromeos/components/tether/wifi_hotspot_connector.cc |
| @@ -21,9 +21,11 @@ namespace tether { |
| WifiHotspotConnector::WifiHotspotConnector( |
| NetworkStateHandler* network_state_handler, |
| - NetworkConnect* network_connect) |
| + NetworkConnect* network_connect, |
| + ActiveHost* active_host) |
| : network_state_handler_(network_state_handler), |
| network_connect_(network_connect), |
| + active_host_(active_host), |
| timer_(base::MakeUnique<base::OneShotTimer>()), |
| weak_ptr_factory_(this) { |
| network_state_handler_->AddObserver(this, FROM_HERE); |
| @@ -79,6 +81,22 @@ void WifiHotspotConnector::NetworkPropertiesUpdated( |
| if (network->connectable()) { |
| // If the network is now connectable, initiate a connection to it. |
|
Kyle Horimoto
2017/04/27 01:28:07
Move this comment to before the ConnectToNetworkId
lesliewatkins
2017/04/28 21:30:43
Done.
|
| + std::string tether_guid = active_host_->GetTetherNetworkGuid(); |
|
Kyle Horimoto
2017/04/27 01:28:07
I apologize for not noticing this earlier, but thi
lesliewatkins
2017/04/28 21:30:43
Done.
|
| + 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_); |
| } |
| } |