| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/components/tether/initializer.h" | 5 #include "chromeos/components/tether/initializer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chromeos/components/tether/active_host.h" | 8 #include "chromeos/components/tether/active_host.h" |
| 9 #include "chromeos/components/tether/active_host_network_state_updater.h" | 9 #include "chromeos/components/tether/active_host_network_state_updater.h" |
| 10 #include "chromeos/components/tether/ble_connection_manager.h" | 10 #include "chromeos/components/tether/ble_connection_manager.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 tether_host_response_recorder_.get()); | 186 tether_host_response_recorder_.get()); |
| 187 wifi_hotspot_connector_ = base::MakeUnique<WifiHotspotConnector>( | 187 wifi_hotspot_connector_ = base::MakeUnique<WifiHotspotConnector>( |
| 188 network_state_handler_, network_connect_); | 188 network_state_handler_, network_connect_); |
| 189 active_host_ = | 189 active_host_ = |
| 190 base::MakeUnique<ActiveHost>(tether_host_fetcher_.get(), pref_service_); | 190 base::MakeUnique<ActiveHost>(tether_host_fetcher_.get(), pref_service_); |
| 191 active_host_network_state_updater_ = | 191 active_host_network_state_updater_ = |
| 192 base::MakeUnique<ActiveHostNetworkStateUpdater>(active_host_.get(), | 192 base::MakeUnique<ActiveHostNetworkStateUpdater>(active_host_.get(), |
| 193 network_state_handler_); | 193 network_state_handler_); |
| 194 device_id_tether_network_guid_map_ = | 194 device_id_tether_network_guid_map_ = |
| 195 base::MakeUnique<DeviceIdTetherNetworkGuidMap>(); | 195 base::MakeUnique<DeviceIdTetherNetworkGuidMap>(); |
| 196 host_scan_cache_ = base::MakeUnique<HostScanCache>( |
| 197 network_state_handler_, active_host_.get(), |
| 198 tether_host_response_recorder_.get(), |
| 199 device_id_tether_network_guid_map_.get()); |
| 200 clock_ = base::MakeUnique<base::DefaultClock>(); |
| 201 host_scanner_ = base::MakeUnique<HostScanner>( |
| 202 tether_host_fetcher_.get(), ble_connection_manager_.get(), |
| 203 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), |
| 204 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), |
| 205 host_scan_cache_.get(), clock_.get()); |
| 206 host_scan_scheduler_ = base::MakeUnique<HostScanScheduler>( |
| 207 network_state_handler_, host_scanner_.get()); |
| 196 tether_connector_ = base::MakeUnique<TetherConnector>( | 208 tether_connector_ = base::MakeUnique<TetherConnector>( |
| 197 network_state_handler_, wifi_hotspot_connector_.get(), active_host_.get(), | 209 network_state_handler_, wifi_hotspot_connector_.get(), active_host_.get(), |
| 198 tether_host_fetcher_.get(), ble_connection_manager_.get(), | 210 tether_host_fetcher_.get(), ble_connection_manager_.get(), |
| 199 tether_host_response_recorder_.get(), | 211 tether_host_response_recorder_.get(), |
| 200 device_id_tether_network_guid_map_.get()); | 212 device_id_tether_network_guid_map_.get(), host_scan_cache_.get(), |
| 213 notification_presenter_.get()); |
| 201 network_configuration_remover_ = | 214 network_configuration_remover_ = |
| 202 base::MakeUnique<NetworkConfigurationRemover>( | 215 base::MakeUnique<NetworkConfigurationRemover>( |
| 203 network_state_handler_, managed_network_configuration_handler_); | 216 network_state_handler_, managed_network_configuration_handler_); |
| 204 tether_disconnector_ = base::MakeUnique<TetherDisconnector>( | 217 tether_disconnector_ = base::MakeUnique<TetherDisconnector>( |
| 205 network_connection_handler_, network_state_handler_, active_host_.get(), | 218 network_connection_handler_, network_state_handler_, active_host_.get(), |
| 206 ble_connection_manager_.get(), network_configuration_remover_.get(), | 219 ble_connection_manager_.get(), network_configuration_remover_.get(), |
| 207 tether_connector_.get(), device_id_tether_network_guid_map_.get(), | 220 tether_connector_.get(), device_id_tether_network_guid_map_.get(), |
| 208 tether_host_fetcher_.get()); | 221 tether_host_fetcher_.get()); |
| 209 tether_network_disconnection_handler_ = | 222 tether_network_disconnection_handler_ = |
| 210 base::MakeUnique<TetherNetworkDisconnectionHandler>( | 223 base::MakeUnique<TetherNetworkDisconnectionHandler>( |
| 211 active_host_.get(), network_state_handler_, | 224 active_host_.get(), network_state_handler_, |
| 212 network_configuration_remover_.get()); | 225 network_configuration_remover_.get()); |
| 213 network_connection_handler_tether_delegate_ = | 226 network_connection_handler_tether_delegate_ = |
| 214 base::MakeUnique<NetworkConnectionHandlerTetherDelegate>( | 227 base::MakeUnique<NetworkConnectionHandlerTetherDelegate>( |
| 215 network_connection_handler_, tether_connector_.get(), | 228 network_connection_handler_, tether_connector_.get(), |
| 216 tether_disconnector_.get()); | 229 tether_disconnector_.get()); |
| 217 host_scan_cache_ = base::MakeUnique<HostScanCache>( | |
| 218 network_state_handler_, active_host_.get(), | |
| 219 tether_host_response_recorder_.get(), | |
| 220 device_id_tether_network_guid_map_.get()); | |
| 221 clock_ = base::MakeUnique<base::DefaultClock>(); | |
| 222 host_scanner_ = base::MakeUnique<HostScanner>( | |
| 223 tether_host_fetcher_.get(), ble_connection_manager_.get(), | |
| 224 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), | |
| 225 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), | |
| 226 host_scan_cache_.get(), clock_.get()); | |
| 227 host_scan_scheduler_ = base::MakeUnique<HostScanScheduler>( | |
| 228 network_state_handler_, host_scanner_.get()); | |
| 229 | 230 |
| 230 // Because Initializer is created on each user log in, it's appropriate to | 231 // Because Initializer is created on each user log in, it's appropriate to |
| 231 // call this method now. | 232 // call this method now. |
| 232 host_scan_scheduler_->UserLoggedIn(); | 233 host_scan_scheduler_->UserLoggedIn(); |
| 233 } | 234 } |
| 234 | 235 |
| 235 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( | 236 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( |
| 236 device::BluetoothAdvertisement::ErrorCode status) { | 237 device::BluetoothAdvertisement::ErrorCode status) { |
| 237 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " | 238 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " |
| 238 << "cannot use tether feature. Error code: " << status; | 239 << "cannot use tether feature. Error code: " << status; |
| 239 } | 240 } |
| 240 | 241 |
| 241 } // namespace tether | 242 } // namespace tether |
| 242 | 243 |
| 243 } // namespace chromeos | 244 } // namespace chromeos |
| OLD | NEW |