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