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_host_pairing_controller.h" | 5 #include "components/pairing/bluetooth_host_pairing_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/hash.h" | 8 #include "base/hash.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 adapter_->SetDiscoverable( | 228 adapter_->SetDiscoverable( |
229 false, | 229 false, |
230 base::Bind(&BluetoothHostPairingController::OnSetDiscoverable, | 230 base::Bind(&BluetoothHostPairingController::OnSetDiscoverable, |
231 ptr_factory_.GetWeakPtr(), false), | 231 ptr_factory_.GetWeakPtr(), false), |
232 base::Bind(&BluetoothHostPairingController::OnSetError, | 232 base::Bind(&BluetoothHostPairingController::OnSetError, |
233 ptr_factory_.GetWeakPtr())); | 233 ptr_factory_.GetWeakPtr())); |
234 | 234 |
235 controller_socket_ = socket; | 235 controller_socket_ = socket; |
236 service_socket_ = NULL; | 236 service_socket_ = NULL; |
237 | 237 |
238 // TODO: Update Host. (http://crbug.com/405754) | |
239 SendHostStatus(); | 238 SendHostStatus(); |
240 | 239 |
241 controller_socket_->Receive( | 240 controller_socket_->Receive( |
242 kReceiveSize, | 241 kReceiveSize, |
243 base::Bind(&BluetoothHostPairingController::OnReceiveComplete, | 242 base::Bind(&BluetoothHostPairingController::OnReceiveComplete, |
244 ptr_factory_.GetWeakPtr()), | 243 ptr_factory_.GetWeakPtr()), |
245 base::Bind(&BluetoothHostPairingController::OnReceiveError, | 244 base::Bind(&BluetoothHostPairingController::OnReceiveError, |
246 ptr_factory_.GetWeakPtr())); | 245 ptr_factory_.GetWeakPtr())); |
247 | 246 |
248 ChangeStage(STAGE_UPDATING); | 247 ChangeStage(STAGE_UPDATING); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION); | 452 ChangeStage(STAGE_WAITING_FOR_CODE_CONFIRMATION); |
454 } | 453 } |
455 | 454 |
456 void BluetoothHostPairingController::AuthorizePairing( | 455 void BluetoothHostPairingController::AuthorizePairing( |
457 device::BluetoothDevice* device) { | 456 device::BluetoothDevice* device) { |
458 // Disallow unknown device. | 457 // Disallow unknown device. |
459 device->RejectPairing(); | 458 device->RejectPairing(); |
460 } | 459 } |
461 | 460 |
462 } // namespace pairing_chromeos | 461 } // namespace pairing_chromeos |
OLD | NEW |