Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: chromeos/network/network_state_handler.cc

Issue 2819303002: Changed wifi arcs to mobile bars for Tether network. (Closed)
Patch Set: Fixed small typo preventing unit tests from building. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b08ff069cee3cdaa9379c135d44d1ae5aa78149f 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -594,13 +594,44 @@ 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.";
+ 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.";
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698