Chromium Code Reviews| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 active_host_.get(), network_state_handler_, | 211 active_host_.get(), network_state_handler_, |
| 212 network_configuration_remover_.get()); | 212 network_configuration_remover_.get()); |
| 213 network_connection_handler_tether_delegate_ = | 213 network_connection_handler_tether_delegate_ = |
| 214 base::MakeUnique<NetworkConnectionHandlerTetherDelegate>( | 214 base::MakeUnique<NetworkConnectionHandlerTetherDelegate>( |
| 215 network_connection_handler_, tether_connector_.get(), | 215 network_connection_handler_, tether_connector_.get(), |
| 216 tether_disconnector_.get()); | 216 tether_disconnector_.get()); |
| 217 host_scan_cache_ = base::MakeUnique<HostScanCache>( | 217 host_scan_cache_ = base::MakeUnique<HostScanCache>( |
| 218 network_state_handler_, active_host_.get(), | 218 network_state_handler_, active_host_.get(), |
| 219 tether_host_response_recorder_.get(), | 219 tether_host_response_recorder_.get(), |
| 220 device_id_tether_network_guid_map_.get()); | 220 device_id_tether_network_guid_map_.get()); |
| 221 clock_ = base::MakeUnique<base::DefaultClock>(); | |
|
khorimoto
2017/05/30 17:39:10
Can you just pass this to the HostScanner construc
| |
| 221 host_scanner_ = base::MakeUnique<HostScanner>( | 222 host_scanner_ = base::MakeUnique<HostScanner>( |
| 222 tether_host_fetcher_.get(), ble_connection_manager_.get(), | 223 tether_host_fetcher_.get(), ble_connection_manager_.get(), |
| 223 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), | 224 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), |
| 224 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), | 225 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), |
| 225 host_scan_cache_.get()); | 226 host_scan_cache_.get(), clock_.get()); |
| 227 host_scan_scheduler_ = base::MakeUnique<HostScanScheduler>( | |
| 228 network_state_handler_, host_scanner_.get()); | |
| 226 | 229 |
| 227 // TODO(khorimoto): Hook up HostScanScheduler. Currently, we simply start a | 230 // Because Initializer is created on each user log in, it's appropriate to |
| 228 // new scan once the user logs in. | 231 // call this method now. |
| 229 host_scanner_->StartScan(); | 232 host_scan_scheduler_->UserLoggedIn(); |
| 230 } | 233 } |
| 231 | 234 |
| 232 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( | 235 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( |
| 233 device::BluetoothAdvertisement::ErrorCode status) { | 236 device::BluetoothAdvertisement::ErrorCode status) { |
| 234 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " | 237 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " |
| 235 << "cannot use tether feature. Error code: " << status; | 238 << "cannot use tether feature. Error code: " << status; |
| 236 } | 239 } |
| 237 | 240 |
| 238 } // namespace tether | 241 } // namespace tether |
| 239 | 242 |
| 240 } // namespace chromeos | 243 } // namespace chromeos |
| OLD | NEW |