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

Unified Diff: chromeos/network/network_connection_handler.cc

Issue 2858943003: [CrOS Tether] Add disconnect handling to NetworkConnectionHandler::TetherDelegate. (Closed)
Patch Set: Rebased. 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
« no previous file with comments | « chromeos/network/network_connection_handler.h ('k') | chromeos/network/network_connection_handler_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_connection_handler.cc
diff --git a/chromeos/network/network_connection_handler.cc b/chromeos/network/network_connection_handler.cc
index bcdbc6e65bf9d29fd4237fd4e0df6daab5ad8f9a..3e7923335ed2f7ef416941dd3c7510dfe72efe97 100644
--- a/chromeos/network/network_connection_handler.cc
+++ b/chromeos/network/network_connection_handler.cc
@@ -58,9 +58,8 @@ const char NetworkConnectionHandler::kErrorUnmanagedNetwork[] =
const char NetworkConnectionHandler::kErrorActivateFailed[] = "activate-failed";
const char NetworkConnectionHandler::kErrorEnabledOrDisabledWhenNotAvailable[] =
"not-available";
-const char
- NetworkConnectionHandler::kErrorTetherConnectionAttemptWithNoDelegate[] =
- "tether-with-no-delegate";
+const char NetworkConnectionHandler::kErrorTetherAttemptWithNoDelegate[] =
+ "tether-with-no-delegate";
NetworkConnectionHandler::NetworkConnectionHandler()
: tether_delegate_(nullptr), weak_ptr_factory_(this) {}
@@ -117,4 +116,20 @@ void NetworkConnectionHandler::InitiateTetherNetworkConnection(
weak_ptr_factory_.GetWeakPtr(), tether_network_guid,
error_callback));
}
+
+void NetworkConnectionHandler::InitiateTetherNetworkDisconnection(
+ const std::string& tether_network_guid,
+ const base::Closure& success_callback,
+ const network_handler::ErrorCallback& error_callback) {
+ DCHECK(tether_delegate_);
+ tether_delegate_->DisconnectFromNetwork(
+ tether_network_guid,
+ base::Bind(&NetworkConnectionHandler::InvokeConnectSuccessCallback,
+ weak_ptr_factory_.GetWeakPtr(), tether_network_guid,
+ success_callback),
+ base::Bind(&NetworkConnectionHandler::InvokeConnectErrorCallback,
+ weak_ptr_factory_.GetWeakPtr(), tether_network_guid,
+ error_callback));
+}
+
} // namespace chromeos
« no previous file with comments | « chromeos/network/network_connection_handler.h ('k') | chromeos/network/network_connection_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698