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

Unified Diff: chromeos/network/network_state_handler.cc

Issue 2819303002: Changed wifi arcs to mobile bars for Tether network. (Closed)
Patch Set: khorimoto@ comments Created 3 years, 8 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..ce5c5f8733b855f584f75935a7d5cc1299995896 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -589,18 +589,48 @@ bool NetworkStateHandler::RemoveTetherNetworkState(const std::string& guid) {
if (iter->get()->AsNetworkState()->guid() == guid) {
NetworkState* wifi_network = GetModifiableNetworkStateFromGuid(
iter->get()->AsNetworkState()->tether_guid());
+
Kyle Horimoto 2017/05/03 01:53:34 nit: Remove changes to functions you did not edit.
lesliewatkins 2017/05/03 22:00:24 Done.
if (wifi_network)
wifi_network->set_tether_guid(std::string());
tether_network_list_.erase(iter);
NotifyNetworkListChanged();
+
return true;
}
}
-
return false;
}
+bool NetworkStateHandler::DisassociateTetherNetworkStateWithWifiNetwork(
+ const std::string& tether_network_guid,
+ const std::string& wifi_network_guid) {
+ bool success = true;
+
+ NetworkState* tether_network =
+ GetModifiableNetworkStateFromGuid(tether_network_guid);
+ NetworkState* wifi_network =
+ GetModifiableNetworkStateFromGuid(wifi_network_guid);
+
+ if (!tether_network) {
+ NET_LOG(ERROR) << "Tether network with guid " << tether_network_guid
Kyle Horimoto 2017/05/03 01:53:34 nit: Make your log more descriptive to tell which
lesliewatkins 2017/05/03 22:00:25 Done.
+ << " doesn\'t exist.\n";
Kyle Horimoto 2017/05/03 01:53:34 nit: You don't need to escape an apostrophe. Same
lesliewatkins 2017/05/03 22:00:25 Done.
+ success = false;
+ } else {
+ tether_network->set_tether_guid(std::string());
+ }
+
+ if (!wifi_network) {
+ NET_LOG(ERROR) << "Wi-Fi network with guid " << wifi_network_guid
+ << " doesn\'t exist.\n";
+ success = false;
+ } else {
+ wifi_network->set_tether_guid(std::string());
+ }
+
Kyle Horimoto 2017/05/03 01:53:34 You need to call NotifyNetworkListChanged() if at
lesliewatkins 2017/05/03 22:00:24 Done.
+ return success;
+}
+
bool NetworkStateHandler::AssociateTetherNetworkStateWithWifiNetwork(
const std::string& tether_network_guid,
const std::string& wifi_network_guid) {

Powered by Google App Engine
This is Rietveld 408576698