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

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

Issue 2857853005: [CrOS Tether] Create TetherDisconnector, which disconnects from active tethering sessions. (Closed)
Patch Set: hansberry@ 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/components/tether/network_connection_handler_tether_delegate.cc
diff --git a/chromeos/components/tether/network_connection_handler_tether_delegate.cc b/chromeos/components/tether/network_connection_handler_tether_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6c2299977fdb792626345d3844511c5e0f1a1b8b
--- /dev/null
+++ b/chromeos/components/tether/network_connection_handler_tether_delegate.cc
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/components/tether/network_connection_handler_tether_delegate.h"
+
+#include "chromeos/components/tether/tether_connector.h"
+#include "chromeos/components/tether/tether_disconnector.h"
+
+namespace chromeos {
+
+namespace tether {
+
+NetworkConnectionHandlerTetherDelegate::NetworkConnectionHandlerTetherDelegate(
+ NetworkConnectionHandler* network_connection_handler,
+ TetherConnector* tether_connector,
+ TetherDisconnector* tether_disconnector)
+ : network_connection_handler_(network_connection_handler),
+ tether_connector_(tether_connector),
+ tether_disconnector_(tether_disconnector) {
+ network_connection_handler_->SetTetherDelegate(this);
+}
+
+NetworkConnectionHandlerTetherDelegate::
+ ~NetworkConnectionHandlerTetherDelegate() {
+ network_connection_handler_->SetTetherDelegate(nullptr);
+}
+
+void NetworkConnectionHandlerTetherDelegate::DisconnectFromNetwork(
+ const std::string& tether_network_guid,
+ const base::Closure& success_callback,
+ const network_handler::StringResultCallback& error_callback) {
+ tether_disconnector_->DisconnectFromNetwork(tether_network_guid,
+ success_callback, error_callback);
+}
+
+void NetworkConnectionHandlerTetherDelegate::ConnectToNetwork(
+ const std::string& tether_network_guid,
+ const base::Closure& success_callback,
+ const network_handler::StringResultCallback& error_callback) {
+ tether_connector_->ConnectToNetwork(tether_network_guid, success_callback,
+ error_callback);
+}
+
+} // namespace tether
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698