| 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" |
| 11 #include "chromeos/components/tether/device_id_tether_network_guid_map.h" | 11 #include "chromeos/components/tether/device_id_tether_network_guid_map.h" |
| 12 #include "chromeos/components/tether/host_connection_metrics_logger.h" |
| 12 #include "chromeos/components/tether/host_scan_cache.h" | 13 #include "chromeos/components/tether/host_scan_cache.h" |
| 13 #include "chromeos/components/tether/host_scan_device_prioritizer_impl.h" | 14 #include "chromeos/components/tether/host_scan_device_prioritizer_impl.h" |
| 14 #include "chromeos/components/tether/host_scan_scheduler.h" | 15 #include "chromeos/components/tether/host_scan_scheduler.h" |
| 15 #include "chromeos/components/tether/host_scanner.h" | 16 #include "chromeos/components/tether/host_scanner.h" |
| 16 #include "chromeos/components/tether/keep_alive_scheduler.h" | 17 #include "chromeos/components/tether/keep_alive_scheduler.h" |
| 17 #include "chromeos/components/tether/network_configuration_remover.h" | 18 #include "chromeos/components/tether/network_configuration_remover.h" |
| 18 #include "chromeos/components/tether/network_connection_handler_tether_delegate.
h" | 19 #include "chromeos/components/tether/network_connection_handler_tether_delegate.
h" |
| 19 #include "chromeos/components/tether/notification_presenter.h" | 20 #include "chromeos/components/tether/notification_presenter.h" |
| 20 #include "chromeos/components/tether/tether_connector.h" | 21 #include "chromeos/components/tether/tether_connector.h" |
| 21 #include "chromeos/components/tether/tether_disconnector.h" | 22 #include "chromeos/components/tether/tether_disconnector.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 tether_host_response_recorder_ = | 185 tether_host_response_recorder_ = |
| 185 base::MakeUnique<TetherHostResponseRecorder>(pref_service_); | 186 base::MakeUnique<TetherHostResponseRecorder>(pref_service_); |
| 186 device_id_tether_network_guid_map_ = | 187 device_id_tether_network_guid_map_ = |
| 187 base::MakeUnique<DeviceIdTetherNetworkGuidMap>(); | 188 base::MakeUnique<DeviceIdTetherNetworkGuidMap>(); |
| 188 host_scan_device_prioritizer_ = | 189 host_scan_device_prioritizer_ = |
| 189 base::MakeUnique<HostScanDevicePrioritizerImpl>( | 190 base::MakeUnique<HostScanDevicePrioritizerImpl>( |
| 190 tether_host_response_recorder_.get(), | 191 tether_host_response_recorder_.get(), |
| 191 device_id_tether_network_guid_map_.get()); | 192 device_id_tether_network_guid_map_.get()); |
| 192 network_state_handler_->set_tether_sort_delegate( | 193 network_state_handler_->set_tether_sort_delegate( |
| 193 host_scan_device_prioritizer_.get()); | 194 host_scan_device_prioritizer_.get()); |
| 195 host_connection_metrics_logger_ = |
| 196 base::MakeUnique<HostConnectionMetricsLogger>(); |
| 194 wifi_hotspot_connector_ = base::MakeUnique<WifiHotspotConnector>( | 197 wifi_hotspot_connector_ = base::MakeUnique<WifiHotspotConnector>( |
| 195 network_state_handler_, network_connect_); | 198 network_state_handler_, network_connect_, |
| 199 host_connection_metrics_logger_.get()); |
| 196 active_host_ = | 200 active_host_ = |
| 197 base::MakeUnique<ActiveHost>(tether_host_fetcher_.get(), pref_service_); | 201 base::MakeUnique<ActiveHost>(tether_host_fetcher_.get(), pref_service_); |
| 198 active_host_network_state_updater_ = | 202 active_host_network_state_updater_ = |
| 199 base::MakeUnique<ActiveHostNetworkStateUpdater>(active_host_.get(), | 203 base::MakeUnique<ActiveHostNetworkStateUpdater>(active_host_.get(), |
| 200 network_state_handler_); | 204 network_state_handler_); |
| 201 host_scan_cache_ = base::MakeUnique<HostScanCache>( | 205 host_scan_cache_ = base::MakeUnique<HostScanCache>( |
| 202 network_state_handler_, active_host_.get(), | 206 network_state_handler_, active_host_.get(), |
| 203 tether_host_response_recorder_.get(), | 207 tether_host_response_recorder_.get(), |
| 204 device_id_tether_network_guid_map_.get()); | 208 device_id_tether_network_guid_map_.get()); |
| 205 keep_alive_scheduler_ = base::MakeUnique<KeepAliveScheduler>( | 209 keep_alive_scheduler_ = base::MakeUnique<KeepAliveScheduler>( |
| 206 active_host_.get(), ble_connection_manager_.get(), host_scan_cache_.get(), | 210 active_host_.get(), ble_connection_manager_.get(), host_scan_cache_.get(), |
| 207 device_id_tether_network_guid_map_.get()); | 211 device_id_tether_network_guid_map_.get()); |
| 208 clock_ = base::MakeUnique<base::DefaultClock>(); | 212 clock_ = base::MakeUnique<base::DefaultClock>(); |
| 209 host_scanner_ = base::MakeUnique<HostScanner>( | 213 host_scanner_ = base::MakeUnique<HostScanner>( |
| 210 tether_host_fetcher_.get(), ble_connection_manager_.get(), | 214 tether_host_fetcher_.get(), ble_connection_manager_.get(), |
| 211 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), | 215 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), |
| 212 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), | 216 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), |
| 213 host_scan_cache_.get(), clock_.get()); | 217 host_scan_cache_.get(), clock_.get()); |
| 214 host_scan_scheduler_ = base::MakeUnique<HostScanScheduler>( | 218 host_scan_scheduler_ = base::MakeUnique<HostScanScheduler>( |
| 215 network_state_handler_, host_scanner_.get()); | 219 network_state_handler_, host_scanner_.get()); |
| 216 tether_connector_ = base::MakeUnique<TetherConnector>( | 220 tether_connector_ = base::MakeUnique<TetherConnector>( |
| 217 network_state_handler_, wifi_hotspot_connector_.get(), active_host_.get(), | 221 network_state_handler_, wifi_hotspot_connector_.get(), active_host_.get(), |
| 218 tether_host_fetcher_.get(), ble_connection_manager_.get(), | 222 tether_host_fetcher_.get(), ble_connection_manager_.get(), |
| 219 tether_host_response_recorder_.get(), | 223 tether_host_response_recorder_.get(), |
| 220 device_id_tether_network_guid_map_.get(), host_scan_cache_.get(), | 224 device_id_tether_network_guid_map_.get(), host_scan_cache_.get(), |
| 221 notification_presenter_.get()); | 225 notification_presenter_.get(), host_connection_metrics_logger_.get()); |
| 222 network_configuration_remover_ = | 226 network_configuration_remover_ = |
| 223 base::MakeUnique<NetworkConfigurationRemover>( | 227 base::MakeUnique<NetworkConfigurationRemover>( |
| 224 network_state_handler_, managed_network_configuration_handler_); | 228 network_state_handler_, managed_network_configuration_handler_); |
| 225 tether_disconnector_ = base::MakeUnique<TetherDisconnector>( | 229 tether_disconnector_ = base::MakeUnique<TetherDisconnector>( |
| 226 network_connection_handler_, network_state_handler_, active_host_.get(), | 230 network_connection_handler_, network_state_handler_, active_host_.get(), |
| 227 ble_connection_manager_.get(), network_configuration_remover_.get(), | 231 ble_connection_manager_.get(), network_configuration_remover_.get(), |
| 228 tether_connector_.get(), device_id_tether_network_guid_map_.get(), | 232 tether_connector_.get(), device_id_tether_network_guid_map_.get(), |
| 229 tether_host_fetcher_.get()); | 233 tether_host_fetcher_.get()); |
| 230 tether_network_disconnection_handler_ = | 234 tether_network_disconnection_handler_ = |
| 231 base::MakeUnique<TetherNetworkDisconnectionHandler>( | 235 base::MakeUnique<TetherNetworkDisconnectionHandler>( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 243 | 247 |
| 244 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( | 248 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( |
| 245 device::BluetoothAdvertisement::ErrorCode status) { | 249 device::BluetoothAdvertisement::ErrorCode status) { |
| 246 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " | 250 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " |
| 247 << "cannot use tether feature. Error code: " << status; | 251 << "cannot use tether feature. Error code: " << status; |
| 248 } | 252 } |
| 249 | 253 |
| 250 } // namespace tether | 254 } // namespace tether |
| 251 | 255 |
| 252 } // namespace chromeos | 256 } // namespace chromeos |
| OLD | NEW |