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

Unified Diff: chromeos/components/tether/tether_network_disconnection_handler.cc

Issue 2821103003: Remove the configuration of Tether-associated Wi-Fi networks once connectivity is lost. (Closed)
Patch Set: Rebase. 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/components/tether/tether_network_disconnection_handler.cc
diff --git a/chromeos/components/tether/tether_network_disconnection_handler.cc b/chromeos/components/tether/tether_network_disconnection_handler.cc
index 71d273db788d2ba6ad697a80cc67b253a15becf4..6c2cb35a520b42894bde620baea81457e2a2f0f2 100644
--- a/chromeos/components/tether/tether_network_disconnection_handler.cc
+++ b/chromeos/components/tether/tether_network_disconnection_handler.cc
@@ -4,7 +4,11 @@
#include "chromeos/components/tether/tether_network_disconnection_handler.h"
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "chromeos/components/tether/network_configuration_remover.h"
#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
@@ -15,15 +19,12 @@ namespace chromeos {
namespace tether {
TetherNetworkDisconnectionHandler::TetherNetworkDisconnectionHandler(
- ActiveHost* active_host)
- : TetherNetworkDisconnectionHandler(
- active_host,
- NetworkHandler::Get()->network_state_handler()) {}
-
-TetherNetworkDisconnectionHandler::TetherNetworkDisconnectionHandler(
ActiveHost* active_host,
- NetworkStateHandler* network_state_handler)
- : active_host_(active_host), network_state_handler_(network_state_handler) {
+ NetworkStateHandler* network_state_handler,
+ NetworkConfigurationRemover* network_configuration_remover)
+ : active_host_(active_host),
+ network_state_handler_(network_state_handler),
+ network_configuration_remover_(network_configuration_remover) {
network_state_handler_->AddObserver(this, FROM_HERE);
}
@@ -39,9 +40,11 @@ void TetherNetworkDisconnectionHandler::NetworkConnectionStateChanged(
!network->IsConnectedState()) {
PA_LOG(INFO) << "Connection to active host (Wi-Fi network GUID "
<< network->guid() << ") has been lost.";
- active_host_->SetActiveHostDisconnected();
- // TODO(hansberry): Remove Wi-Fi network from "known" networks.
+ network_configuration_remover_->RemoveNetworkConfiguration(
+ active_host_->GetWifiNetworkGuid());
+
+ active_host_->SetActiveHostDisconnected();
}
}

Powered by Google App Engine
This is Rietveld 408576698