| 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" | |
| 13 #include "chromeos/components/tether/host_scan_device_prioritizer.h" | 12 #include "chromeos/components/tether/host_scan_device_prioritizer.h" |
| 14 #include "chromeos/components/tether/host_scan_scheduler.h" | 13 #include "chromeos/components/tether/host_scan_scheduler.h" |
| 15 #include "chromeos/components/tether/host_scanner.h" | 14 #include "chromeos/components/tether/host_scanner.h" |
| 16 #include "chromeos/components/tether/local_device_data_provider.h" | 15 #include "chromeos/components/tether/local_device_data_provider.h" |
| 17 #include "chromeos/components/tether/network_configuration_remover.h" | 16 #include "chromeos/components/tether/network_configuration_remover.h" |
| 18 #include "chromeos/components/tether/notification_presenter.h" | 17 #include "chromeos/components/tether/notification_presenter.h" |
| 19 #include "chromeos/components/tether/tether_connector.h" | 18 #include "chromeos/components/tether/tether_connector.h" |
| 20 #include "chromeos/components/tether/tether_device_state_manager.h" | 19 #include "chromeos/components/tether/tether_device_state_manager.h" |
| 21 #include "chromeos/components/tether/tether_host_fetcher.h" | 20 #include "chromeos/components/tether/tether_host_fetcher.h" |
| 22 #include "chromeos/components/tether/tether_host_response_recorder.h" | 21 #include "chromeos/components/tether/tether_host_response_recorder.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 tether_host_fetcher_.get(), ble_connection_manager_.get(), | 199 tether_host_fetcher_.get(), ble_connection_manager_.get(), |
| 201 tether_host_response_recorder_.get(), | 200 tether_host_response_recorder_.get(), |
| 202 device_id_tether_network_guid_map_.get()); | 201 device_id_tether_network_guid_map_.get()); |
| 203 network_configuration_remover_ = | 202 network_configuration_remover_ = |
| 204 base::MakeUnique<NetworkConfigurationRemover>( | 203 base::MakeUnique<NetworkConfigurationRemover>( |
| 205 network_state_handler_, managed_network_configuration_handler_); | 204 network_state_handler_, managed_network_configuration_handler_); |
| 206 tether_network_disconnection_handler_ = | 205 tether_network_disconnection_handler_ = |
| 207 base::MakeUnique<TetherNetworkDisconnectionHandler>( | 206 base::MakeUnique<TetherNetworkDisconnectionHandler>( |
| 208 active_host_.get(), network_state_handler_, | 207 active_host_.get(), network_state_handler_, |
| 209 network_configuration_remover_.get()); | 208 network_configuration_remover_.get()); |
| 210 host_scan_cache_ = base::MakeUnique<HostScanCache>( | |
| 211 network_state_handler_, active_host_.get(), | |
| 212 tether_host_response_recorder_.get(), | |
| 213 device_id_tether_network_guid_map_.get()); | |
| 214 host_scanner_ = base::MakeUnique<HostScanner>( | 209 host_scanner_ = base::MakeUnique<HostScanner>( |
| 215 tether_host_fetcher_.get(), ble_connection_manager_.get(), | 210 tether_host_fetcher_.get(), ble_connection_manager_.get(), |
| 216 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), | 211 host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(), |
| 217 notification_presenter_.get(), device_id_tether_network_guid_map_.get(), | 212 network_state_handler_, notification_presenter_.get(), |
| 218 host_scan_cache_.get()); | 213 device_id_tether_network_guid_map_.get()); |
| 219 | 214 |
| 220 // TODO(khorimoto): Hook up HostScanScheduler. Currently, we simply start a | 215 // TODO(khorimoto): Hook up HostScanScheduler. Currently, we simply start a |
| 221 // new scan once the user logs in. | 216 // new scan once the user logs in. |
| 222 host_scanner_->StartScan(); | 217 host_scanner_->StartScan(); |
| 223 } | 218 } |
| 224 | 219 |
| 225 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( | 220 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( |
| 226 device::BluetoothAdvertisement::ErrorCode status) { | 221 device::BluetoothAdvertisement::ErrorCode status) { |
| 227 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " | 222 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " |
| 228 << "cannot use tether feature. Error code: " << status; | 223 << "cannot use tether feature. Error code: " << status; |
| 229 } | 224 } |
| 230 | 225 |
| 231 } // namespace tether | 226 } // namespace tether |
| 232 | 227 |
| 233 } // namespace chromeos | 228 } // namespace chromeos |
| OLD | NEW |