Index: chromeos/network/network_state_handler.cc |
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc |
index 2ba68620e0c2b8b5d69b4918b7c68e68724d1b3d..53a2caa6b378c0ff4b0d1557a55d0daf31efd1c4 100644 |
--- a/chromeos/network/network_state_handler.cc |
+++ b/chromeos/network/network_state_handler.cc |
@@ -594,13 +594,45 @@ bool NetworkStateHandler::RemoveTetherNetworkState(const std::string& guid) { |
tether_network_list_.erase(iter); |
NotifyNetworkListChanged(); |
+ |
return true; |
} |
} |
- |
return false; |
} |
+bool NetworkStateHandler::DisassociateTetherNetworkStateFromWifiNetwork( |
+ const std::string& tether_network_guid) { |
+ NetworkState* tether_network = |
+ GetModifiableNetworkStateFromGuid(tether_network_guid); |
+ |
+ if (!tether_network) { |
+ NET_LOG(ERROR) << "DisassociateTetherNetworkStateWithWifiNetwork(): Tether " |
+ << "network with ID " << tether_network_guid |
+ << " " |
+ "not registered; could not remove association."; |
stevenjb
2017/05/04 17:21:27
What Kyle meant was:
NET_LOG(ERROR) << "Disassocia
lesliewatkins
2017/05/04 17:31:04
Done.
|
+ return false; |
+ } |
+ |
+ std::string wifi_network_guid = tether_network->tether_guid(); |
+ NetworkState* wifi_network = |
+ GetModifiableNetworkStateFromGuid(wifi_network_guid); |
+ |
+ if (!wifi_network) { |
+ NET_LOG(ERROR) << "DisassociateTetherNetworkStateWithWifiNetwork(): Wi-Fi " |
+ << "network with ID " << wifi_network_guid |
+ << " not registered; could not remove association."; |
stevenjb
2017/05/04 17:21:27
nit: Same " " issue here (but as Kyle mentioned, i
lesliewatkins
2017/05/04 17:31:04
Done.
|
+ return false; |
+ } |
+ |
+ wifi_network->set_tether_guid(std::string()); |
+ tether_network->set_tether_guid(std::string()); |
+ |
+ NotifyNetworkListChanged(); |
+ |
+ return true; |
+} |
+ |
bool NetworkStateHandler::AssociateTetherNetworkStateWithWifiNetwork( |
const std::string& tether_network_guid, |
const std::string& wifi_network_guid) { |