OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/components/tether/tether_connector.h" | 5 #include "chromeos/components/tether/tether_connector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chromeos/components/tether/active_host.h" | 8 #include "chromeos/components/tether/active_host.h" |
9 #include "chromeos/components/tether/device_id_tether_network_guid_map.h" | 9 #include "chromeos/components/tether/device_id_tether_network_guid_map.h" |
10 #include "chromeos/components/tether/tether_host_fetcher.h" | 10 #include "chromeos/components/tether/tether_host_fetcher.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // If the Wi-Fi network ID is empty, then the connection did not succeed. | 199 // If the Wi-Fi network ID is empty, then the connection did not succeed. |
200 PA_LOG(ERROR) << "Failed to connect to the hotspot belonging to the device " | 200 PA_LOG(ERROR) << "Failed to connect to the hotspot belonging to the device " |
201 << "with ID " | 201 << "with ID " |
202 << cryptauth::RemoteDevice::TruncateDeviceIdForLogs(device_id) | 202 << cryptauth::RemoteDevice::TruncateDeviceIdForLogs(device_id) |
203 << "."; | 203 << "."; |
204 | 204 |
205 SetDisconnected(); | 205 SetDisconnected(); |
206 return; | 206 return; |
207 } | 207 } |
208 | 208 |
209 bool successful_association = | |
210 network_state_handler_->AssociateTetherNetworkStateWithWifiNetwork( | |
211 device_id, wifi_network_guid); | |
212 if (successful_association) { | |
213 PA_LOG(INFO) << "Successfully connected to host device with ID " | |
214 << cryptauth::RemoteDevice::TruncateDeviceIdForLogs(device_id) | |
215 << ". Tether network ID: \"" << device_id | |
216 << "\", Wi-Fi network ID: \"" << wifi_network_guid << "\""; | |
217 } else { | |
218 PA_LOG(WARNING) << "Successfully connected to host device with ID " | |
219 << cryptauth::RemoteDevice::TruncateDeviceIdForLogs( | |
220 device_id) | |
221 << ", but failed to associate tether network with ID \"" | |
222 << device_id << "\" to Wi-Fi network with ID \"" | |
223 << wifi_network_guid << "\"."; | |
224 } | |
225 | |
226 SetConnected(device_id, wifi_network_guid); | 209 SetConnected(device_id, wifi_network_guid); |
227 } | 210 } |
228 | 211 |
229 } // namespace tether | 212 } // namespace tether |
230 | 213 |
231 } // namespace chromeos | 214 } // namespace chromeos |
OLD | NEW |