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_device_prioritizer.h" | 12 #include "chromeos/components/tether/host_scan_device_prioritizer.h" |
13 #include "chromeos/components/tether/host_scan_scheduler.h" | 13 #include "chromeos/components/tether/host_scan_scheduler.h" |
14 #include "chromeos/components/tether/host_scanner.h" | 14 #include "chromeos/components/tether/host_scanner.h" |
15 #include "chromeos/components/tether/local_device_data_provider.h" | 15 #include "chromeos/components/tether/local_device_data_provider.h" |
16 #include "chromeos/components/tether/notification_presenter.h" | 16 #include "chromeos/components/tether/notification_presenter.h" |
17 #include "chromeos/components/tether/tether_connector.h" | 17 #include "chromeos/components/tether/tether_connector.h" |
18 #include "chromeos/components/tether/tether_device_state_manager.h" | |
19 #include "chromeos/components/tether/tether_host_fetcher.h" | 18 #include "chromeos/components/tether/tether_host_fetcher.h" |
20 #include "chromeos/components/tether/wifi_hotspot_connector.h" | 19 #include "chromeos/components/tether/wifi_hotspot_connector.h" |
21 #include "chromeos/network/network_connect.h" | 20 #include "chromeos/network/network_connect.h" |
22 #include "chromeos/network/network_state_handler.h" | 21 #include "chromeos/network/network_state_handler.h" |
23 #include "components/cryptauth/bluetooth_throttler_impl.h" | 22 #include "components/cryptauth/bluetooth_throttler_impl.h" |
24 #include "components/cryptauth/cryptauth_service.h" | 23 #include "components/cryptauth/cryptauth_service.h" |
25 #include "components/cryptauth/remote_beacon_seed_fetcher.h" | 24 #include "components/cryptauth/remote_beacon_seed_fetcher.h" |
26 #include "components/prefs/pref_service.h" | 25 #include "components/prefs/pref_service.h" |
27 #include "components/proximity_auth/logging/logging.h" | 26 #include "components/proximity_auth/logging/logging.h" |
28 #include "device/bluetooth/bluetooth_adapter.h" | 27 #include "device/bluetooth/bluetooth_adapter.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 weak_ptr_factory_.GetWeakPtr(), adapter), | 145 weak_ptr_factory_.GetWeakPtr(), adapter), |
147 base::Bind(&Initializer::OnBluetoothAdapterAdvertisingIntervalError, | 146 base::Bind(&Initializer::OnBluetoothAdapterAdvertisingIntervalError, |
148 weak_ptr_factory_.GetWeakPtr())); | 147 weak_ptr_factory_.GetWeakPtr())); |
149 } | 148 } |
150 | 149 |
151 void Initializer::OnBluetoothAdapterAdvertisingIntervalSet( | 150 void Initializer::OnBluetoothAdapterAdvertisingIntervalSet( |
152 scoped_refptr<device::BluetoothAdapter> adapter) { | 151 scoped_refptr<device::BluetoothAdapter> adapter) { |
153 PA_LOG(INFO) << "Successfully set Bluetooth advertisement interval. " | 152 PA_LOG(INFO) << "Successfully set Bluetooth advertisement interval. " |
154 << "Initializing tether feature."; | 153 << "Initializing tether feature."; |
155 | 154 |
156 tether_device_state_manager_ = | |
157 base::MakeUnique<TetherDeviceStateManager>(network_state_handler_); | |
158 tether_host_fetcher_ = | 155 tether_host_fetcher_ = |
159 base::MakeUnique<TetherHostFetcher>(cryptauth_service_); | 156 base::MakeUnique<TetherHostFetcher>(cryptauth_service_); |
160 local_device_data_provider_ = | 157 local_device_data_provider_ = |
161 base::MakeUnique<LocalDeviceDataProvider>(cryptauth_service_); | 158 base::MakeUnique<LocalDeviceDataProvider>(cryptauth_service_); |
162 remote_beacon_seed_fetcher_ = | 159 remote_beacon_seed_fetcher_ = |
163 base::MakeUnique<cryptauth::RemoteBeaconSeedFetcher>( | 160 base::MakeUnique<cryptauth::RemoteBeaconSeedFetcher>( |
164 cryptauth_service_->GetCryptAuthDeviceManager()); | 161 cryptauth_service_->GetCryptAuthDeviceManager()); |
165 ble_connection_manager_ = base::MakeUnique<BleConnectionManager>( | 162 ble_connection_manager_ = base::MakeUnique<BleConnectionManager>( |
166 cryptauth_service_, adapter, local_device_data_provider_.get(), | 163 cryptauth_service_, adapter, local_device_data_provider_.get(), |
167 remote_beacon_seed_fetcher_.get(), | 164 remote_beacon_seed_fetcher_.get(), |
(...skipping 26 matching lines...) Expand all Loading... |
194 | 191 |
195 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( | 192 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( |
196 device::BluetoothAdvertisement::ErrorCode status) { | 193 device::BluetoothAdvertisement::ErrorCode status) { |
197 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " | 194 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " |
198 << "cannot use tether feature. Error code: " << status; | 195 << "cannot use tether feature. Error code: " << status; |
199 } | 196 } |
200 | 197 |
201 } // namespace tether | 198 } // namespace tether |
202 | 199 |
203 } // namespace chromeos | 200 } // namespace chromeos |
OLD | NEW |