| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/pairing/bluetooth_controller_pairing_controller.h" | 5 #include "components/pairing/bluetooth_controller_pairing_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 adapter_->SetPowered( | 125 adapter_->SetPowered( |
| 126 true, | 126 true, |
| 127 base::Bind(&BluetoothControllerPairingController::OnSetPowered, | 127 base::Bind(&BluetoothControllerPairingController::OnSetPowered, |
| 128 ptr_factory_.GetWeakPtr()), | 128 ptr_factory_.GetWeakPtr()), |
| 129 base::Bind(&BluetoothControllerPairingController::OnError, | 129 base::Bind(&BluetoothControllerPairingController::OnError, |
| 130 ptr_factory_.GetWeakPtr())); | 130 ptr_factory_.GetWeakPtr())); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 void BluetoothControllerPairingController::OnStartDiscoverySession( | 134 void BluetoothControllerPairingController::OnStartDiscoverySession( |
| 135 scoped_ptr<device::BluetoothDiscoverySession> discovery_session) { | 135 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session) { |
| 136 DCHECK(thread_checker_.CalledOnValidThread()); | 136 DCHECK(thread_checker_.CalledOnValidThread()); |
| 137 discovery_session_ = std::move(discovery_session); | 137 discovery_session_ = std::move(discovery_session); |
| 138 ChangeStage(STAGE_DEVICES_DISCOVERY); | 138 ChangeStage(STAGE_DEVICES_DISCOVERY); |
| 139 | 139 |
| 140 for (const auto& device : adapter_->GetDevices()) | 140 for (const auto& device : adapter_->GetDevices()) |
| 141 DeviceFound(device); | 141 DeviceFound(device); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void BluetoothControllerPairingController::OnConnect() { | 144 void BluetoothControllerPairingController::OnConnect() { |
| 145 DCHECK(thread_checker_.CalledOnValidThread()); | 145 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION); | 499 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void BluetoothControllerPairingController::AuthorizePairing( | 502 void BluetoothControllerPairingController::AuthorizePairing( |
| 503 device::BluetoothDevice* device) { | 503 device::BluetoothDevice* device) { |
| 504 // Disallow unknown device. | 504 // Disallow unknown device. |
| 505 device->RejectPairing(); | 505 device->RejectPairing(); |
| 506 } | 506 } |
| 507 | 507 |
| 508 } // namespace pairing_chromeos | 508 } // namespace pairing_chromeos |
| OLD | NEW |