Index: chromeos/components/tether/initializer.cc |
diff --git a/chromeos/components/tether/initializer.cc b/chromeos/components/tether/initializer.cc |
index 9d12a935dbd84d23c274e7d511a6d0df475412ab..12215d998a1cdcfe9db87cfe8027e4c8af3d0619 100644 |
--- a/chromeos/components/tether/initializer.cc |
+++ b/chromeos/components/tether/initializer.cc |
@@ -16,7 +16,9 @@ |
#include "chromeos/components/tether/notification_presenter.h" |
#include "chromeos/components/tether/tether_connector.h" |
#include "chromeos/components/tether/tether_host_fetcher.h" |
+#include "chromeos/components/tether/tether_network_disconnection_handler.h" |
#include "chromeos/components/tether/wifi_hotspot_connector.h" |
+#include "chromeos/network/managed_network_configuration_handler.h" |
#include "chromeos/network/network_connect.h" |
#include "chromeos/network/network_state_handler.h" |
#include "components/cryptauth/bluetooth_throttler_impl.h" |
@@ -50,6 +52,7 @@ void Initializer::Init( |
PrefService* pref_service, |
ProfileOAuth2TokenService* token_service, |
NetworkStateHandler* network_state_handler, |
+ ManagedNetworkConfigurationHandler* managed_network_configuration_handler, |
NetworkConnect* network_connect) { |
if (!device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) { |
PA_LOG(WARNING) << "Bluetooth is unavailable on this device; cannot " |
@@ -64,9 +67,10 @@ void Initializer::Init( |
return; |
} |
- instance_ = new Initializer( |
- cryptauth_service, std::move(notification_presenter), pref_service, |
- token_service, network_state_handler, network_connect); |
+ instance_ = |
+ new Initializer(cryptauth_service, std::move(notification_presenter), |
+ pref_service, token_service, network_state_handler, |
+ managed_network_configuration_handler, network_connect); |
} |
// static |
@@ -90,12 +94,15 @@ Initializer::Initializer( |
PrefService* pref_service, |
ProfileOAuth2TokenService* token_service, |
NetworkStateHandler* network_state_handler, |
+ ManagedNetworkConfigurationHandler* managed_network_configuration_handler, |
NetworkConnect* network_connect) |
: cryptauth_service_(cryptauth_service), |
notification_presenter_(std::move(notification_presenter)), |
pref_service_(pref_service), |
token_service_(token_service), |
network_state_handler_(network_state_handler), |
+ managed_network_configuration_handler_( |
+ managed_network_configuration_handler), |
network_connect_(network_connect), |
weak_ptr_factory_(this) { |
if (!token_service_->RefreshTokenIsAvailable( |
@@ -179,6 +186,10 @@ void Initializer::OnBluetoothAdapterAdvertisingIntervalSet( |
active_host_.get(), tether_host_fetcher_.get(), |
ble_connection_manager_.get(), host_scan_device_prioritizer_.get(), |
device_id_tether_network_guid_map_.get()); |
+ tether_network_disconnection_handler_ = |
+ base::MakeUnique<TetherNetworkDisconnectionHandler>( |
+ active_host_.get(), network_state_handler_, |
+ managed_network_configuration_handler_); |
host_scanner_ = base::MakeUnique<HostScanner>( |
tether_host_fetcher_.get(), ble_connection_manager_.get(), |
host_scan_device_prioritizer_.get(), network_state_handler_, |