Index: chromeos/components/tether/tether_disconnector_impl.h |
diff --git a/chromeos/components/tether/tether_disconnector.h b/chromeos/components/tether/tether_disconnector_impl.h |
similarity index 76% |
copy from chromeos/components/tether/tether_disconnector.h |
copy to chromeos/components/tether/tether_disconnector_impl.h |
index b620b92a139c29bf3d5b837c90a249e3c615b74e..886e53365c75db2d341bbed4d25297895c5e321e 100644 |
--- a/chromeos/components/tether/tether_disconnector.h |
+++ b/chromeos/components/tether/tether_disconnector_impl.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROMEOS_COMPONENTS_TETHER_TETHER_DISCONNECTOR_H_ |
-#define CHROMEOS_COMPONENTS_TETHER_TETHER_DISCONNECTOR_H_ |
+#ifndef CHROMEOS_COMPONENTS_TETHER_TETHER_DISCONNECTOR_IMPL_H_ |
+#define CHROMEOS_COMPONENTS_TETHER_TETHER_DISCONNECTOR_IMPL_H_ |
#include <memory> |
#include <string> |
@@ -13,8 +13,12 @@ |
#include "base/macros.h" |
#include "base/memory/weak_ptr.h" |
#include "chromeos/components/tether/disconnect_tethering_operation.h" |
+#include "chromeos/components/tether/tether_disconnector.h" |
#include "chromeos/network/network_handler_callbacks.h" |
+class PrefRegistrySimple; |
+class PrefService; |
+ |
namespace base { |
class DictionaryValue; |
} |
@@ -33,9 +37,13 @@ class NetworkConfigurationRemover; |
class TetherConnector; |
class TetherHostFetcher; |
-class TetherDisconnector : public DisconnectTetheringOperation::Observer { |
+class TetherDisconnectorImpl : public TetherDisconnector, |
+ public DisconnectTetheringOperation::Observer { |
public: |
- TetherDisconnector( |
+ // Registers the prefs used by this class to the given |registry|. |
+ static void RegisterPrefs(PrefRegistrySimple* registry); |
Ryan Hansberry
2017/07/11 22:23:56
Why a RegisterPrefs on the interface and impl?
Kyle Horimoto
2017/07/12 01:42:59
Should only have been here - fixed.
|
+ |
+ TetherDisconnectorImpl( |
NetworkConnectionHandler* network_connection_handler, |
NetworkStateHandler* network_state_handler, |
ActiveHost* active_host, |
@@ -43,19 +51,20 @@ class TetherDisconnector : public DisconnectTetheringOperation::Observer { |
NetworkConfigurationRemover* network_configuration_remover, |
TetherConnector* tether_connector, |
DeviceIdTetherNetworkGuidMap* device_id_tether_network_guid_map, |
- TetherHostFetcher* tether_host_fetcher); |
- virtual ~TetherDisconnector(); |
+ TetherHostFetcher* tether_host_fetcher, |
+ PrefService* pref_service); |
+ ~TetherDisconnectorImpl() override; |
- virtual void DisconnectFromNetwork( |
+ void DisconnectFromNetwork( |
const std::string& tether_network_guid, |
const base::Closure& success_callback, |
- const network_handler::StringResultCallback& error_callback); |
+ const network_handler::StringResultCallback& error_callback) override; |
// DisconnectTetheringOperation::Observer: |
void OnOperationFinished(const std::string& device_id, bool success) override; |
private: |
- friend class TetherDisconnectorTest; |
+ friend class TetherDisconnectorImplTest; |
void DisconnectActiveWifiConnection( |
const std::string& tether_network_guid, |
@@ -89,15 +98,16 @@ class TetherDisconnector : public DisconnectTetheringOperation::Observer { |
TetherConnector* tether_connector_; |
DeviceIdTetherNetworkGuidMap* device_id_tether_network_guid_map_; |
TetherHostFetcher* tether_host_fetcher_; |
+ PrefService* pref_service_; |
std::unique_ptr<DisconnectTetheringOperation> disconnect_tethering_operation_; |
- base::WeakPtrFactory<TetherDisconnector> weak_ptr_factory_; |
+ base::WeakPtrFactory<TetherDisconnectorImpl> weak_ptr_factory_; |
- DISALLOW_COPY_AND_ASSIGN(TetherDisconnector); |
+ DISALLOW_COPY_AND_ASSIGN(TetherDisconnectorImpl); |
}; |
} // namespace tether |
} // namespace chromeos |
-#endif // CHROMEOS_COMPONENTS_TETHER_TETHER_DISCONNECTOR_H_ |
+#endif // CHROMEOS_COMPONENTS_TETHER_TETHER_DISCONNECTOR_IMPL_H_ |