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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 cryptauth::CryptAuthService* cryptauth_service, | 57 cryptauth::CryptAuthService* cryptauth_service, |
| 58 std::unique_ptr<NotificationPresenter> notification_presenter, | 58 std::unique_ptr<NotificationPresenter> notification_presenter, |
| 59 PrefService* pref_service, | 59 PrefService* pref_service, |
| 60 ProfileOAuth2TokenService* token_service, | 60 ProfileOAuth2TokenService* token_service, |
| 61 NetworkStateHandler* network_state_handler, | 61 NetworkStateHandler* network_state_handler, |
| 62 ManagedNetworkConfigurationHandler* managed_network_configuration_handler, | 62 ManagedNetworkConfigurationHandler* managed_network_configuration_handler, |
| 63 NetworkConnect* network_connect, | 63 NetworkConnect* network_connect, |
| 64 NetworkConnectionHandler* network_connection_handler) { | 64 NetworkConnectionHandler* network_connection_handler) { |
| 65 if (!device::BluetoothAdapterFactory::IsBluetoothSupported()) { | 65 if (!device::BluetoothAdapterFactory::IsBluetoothSupported()) { |
| 66 PA_LOG(WARNING) << "Bluetooth is not supported on this device; cannot " | 66 PA_LOG(WARNING) << "Bluetooth is not supported on this device; cannot " |
| 67 << "initialize tether feature."; | 67 << "initialize Tether feature."; |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 | 70 |
| 71 if (instance_) { | 71 if (instance_) { |
| 72 PA_LOG(WARNING) << "Tether initialization was triggered when the feature " | 72 // The Tether feature has already been initialized. No need to do anything. |
| 73 << "had already been initialized; exiting initialization " | |
| 74 << "early."; | |
| 75 return; | 73 return; |
| 76 } | 74 } |
| 77 | 75 |
| 76 PA_LOG(INFO) << "Initializer Tether feature."; | |
|
Ryan Hansberry
2017/06/26 23:55:08
Is this log needed? If so, the phrasing is awkward
Kyle Horimoto
2017/06/27 00:56:01
Fixed typo. Yes, I think this log is useful. There
| |
| 78 instance_ = | 77 instance_ = |
| 79 new Initializer(cryptauth_service, std::move(notification_presenter), | 78 new Initializer(cryptauth_service, std::move(notification_presenter), |
| 80 pref_service, token_service, network_state_handler, | 79 pref_service, token_service, network_state_handler, |
| 81 managed_network_configuration_handler, network_connect, | 80 managed_network_configuration_handler, network_connect, |
| 82 network_connection_handler); | 81 network_connection_handler); |
| 83 } | 82 } |
| 84 | 83 |
| 85 // static | 84 // static |
| 86 void Initializer::Shutdown() { | 85 void Initializer::Shutdown() { |
| 87 if (instance_) { | 86 if (instance_) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 | 243 |
| 245 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( | 244 void Initializer::OnBluetoothAdapterAdvertisingIntervalError( |
| 246 device::BluetoothAdvertisement::ErrorCode status) { | 245 device::BluetoothAdvertisement::ErrorCode status) { |
| 247 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " | 246 PA_LOG(ERROR) << "Failed to set Bluetooth advertisement interval; " |
| 248 << "cannot use tether feature. Error code: " << status; | 247 << "cannot use tether feature. Error code: " << status; |
| 249 } | 248 } |
| 250 | 249 |
| 251 } // namespace tether | 250 } // namespace tether |
| 252 | 251 |
| 253 } // namespace chromeos | 252 } // namespace chromeos |
| OLD | NEW |