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_scan_cache.h" | 12 #include "chromeos/components/tether/host_scan_cache.h" |
13 #include "chromeos/components/tether/host_scan_device_prioritizer.h" | 13 #include "chromeos/components/tether/host_scan_device_prioritizer.h" |
14 #include "chromeos/components/tether/host_scan_scheduler.h" | 14 #include "chromeos/components/tether/host_scan_scheduler.h" |
15 #include "chromeos/components/tether/host_scanner.h" | 15 #include "chromeos/components/tether/host_scanner.h" |
| 16 #include "chromeos/components/tether/keep_alive_scheduler.h" |
16 #include "chromeos/components/tether/local_device_data_provider.h" | 17 #include "chromeos/components/tether/local_device_data_provider.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" |
22 #include "chromeos/components/tether/tether_host_fetcher.h" | 23 #include "chromeos/components/tether/tether_host_fetcher.h" |
23 #include "chromeos/components/tether/tether_host_response_recorder.h" | 24 #include "chromeos/components/tether/tether_host_response_recorder.h" |
24 #include "chromeos/components/tether/tether_network_disconnection_handler.h" | 25 #include "chromeos/components/tether/tether_network_disconnection_handler.h" |
25 #include "chromeos/components/tether/wifi_hotspot_connector.h" | 26 #include "chromeos/components/tether/wifi_hotspot_connector.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 active_host_.get(), network_state_handler_, | 212 active_host_.get(), network_state_handler_, |
212 network_configuration_remover_.get()); | 213 network_configuration_remover_.get()); |
213 network_connection_handler_tether_delegate_ = | 214 network_connection_handler_tether_delegate_ = |
214 base::MakeUnique<NetworkConnectionHandlerTetherDelegate>( | 215 base::MakeUnique<NetworkConnectionHandlerTetherDelegate>( |
215 network_connection_handler_, tether_connector_.get(), | 216 network_connection_handler_, tether_connector_.get(), |
216 tether_disconnector_.get()); | 217 tether_disconnector_.get()); |
217 host_scan_cache_ = base::MakeUnique<HostScanCache>( | 218 host_scan_cache_ = base::MakeUnique<HostScanCache>( |
218 network_state_handler_, active_host_.get(), | 219 network_state_handler_, active_host_.get(), |
219 tether_host_response_recorder_.get(), | 220 tether_host_response_recorder_.get(), |
220 device_id_tether_network_guid_map_.get()); | 221 device_id_tether_network_guid_map_.get()); |
| 222 keep_alive_scheduler_ = base::MakeUnique<KeepAliveScheduler>( |
| 223 active_host_.get(), ble_connection_manager_.get(), host_scan_cache_.get(), |
| 224 device_id_tether_network_guid_map_.get()); |
221 clock_ = base::MakeUnique<base::DefaultClock>(); | 225 clock_ = base::MakeUnique<base::DefaultClock>(); |
222 host_scanner_ = base::MakeUnique<HostScanner>( | 226 host_scanner_ = base::MakeUnique<HostScanner>( |
223 tether_host_fetcher_.get(), ble_connection_manager_.get(), | 227 tether_host_fetcher_.get(), ble_connection_manager_.get(), |
224 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), | 228 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), |
225 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), | 229 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), |
226 host_scan_cache_.get(), clock_.get()); | 230 host_scan_cache_.get(), clock_.get()); |
227 host_scan_scheduler_ = base::MakeUnique<HostScanScheduler>( | 231 host_scan_scheduler_ = base::MakeUnique<HostScanScheduler>( |
228 network_state_handler_, host_scanner_.get()); | 232 network_state_handler_, host_scanner_.get()); |
229 | 233 |
230 // Because Initializer is created on each user log in, it's appropriate to | 234 // Because Initializer is created on each user log in, it's appropriate to |
231 // call this method now. | 235 // call this method now. |
232 host_scan_scheduler_->UserLoggedIn(); | 236 host_scan_scheduler_->UserLoggedIn(); |
233 } | 237 } |
234 | 238 |
235 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( | 239 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( |
236 device::BluetoothAdvertisement::ErrorCode status) { | 240 device::BluetoothAdvertisement::ErrorCode status) { |
237 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " | 241 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " |
238 << "cannot use tether feature. Error code: " << status; | 242 << "cannot use tether feature. Error code: " << status; |
239 } | 243 } |
240 | 244 |
241 } // namespace tether | 245 } // namespace tether |
242 | 246 |
243 } // namespace chromeos | 247 } // namespace chromeos |
OLD | NEW |