| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "device/bluetooth/bluetooth_device_experimental_chromeos.h" | 5 #include "device/bluetooth/bluetooth_device_experimental_chromeos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chromeos/dbus/dbus_thread_manager.h" | 8 #include "chromeos/dbus/dbus_thread_manager.h" |
| 9 #include "chromeos/dbus/experimental_bluetooth_adapter_client.h" | 9 #include "chromeos/dbus/experimental_bluetooth_adapter_client.h" |
| 10 #include "chromeos/dbus/experimental_bluetooth_agent_manager_client.h" | 10 #include "chromeos/dbus/experimental_bluetooth_agent_manager_client.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 } | 320 } |
| 321 | 321 |
| 322 void BluetoothDeviceExperimentalChromeOS::DisplayPasskey( | 322 void BluetoothDeviceExperimentalChromeOS::DisplayPasskey( |
| 323 const dbus::ObjectPath& device_path, | 323 const dbus::ObjectPath& device_path, |
| 324 uint32 passkey, int16 entered) { | 324 uint32 passkey, int16 entered) { |
| 325 DCHECK(agent_.get()); | 325 DCHECK(agent_.get()); |
| 326 DCHECK(device_path == object_path_); | 326 DCHECK(device_path == object_path_); |
| 327 VLOG(1) << object_path_.value() << ": DisplayPasskey: " << passkey | 327 VLOG(1) << object_path_.value() << ": DisplayPasskey: " << passkey |
| 328 << " (" << entered << " entered)"; | 328 << " (" << entered << " entered)"; |
| 329 | 329 |
| 330 // TODO(keybuk): disambiguate entered vs display | |
| 331 if (entered > 0) | |
| 332 return; | |
| 333 | |
| 334 DCHECK(pairing_delegate_); | 330 DCHECK(pairing_delegate_); |
| 335 pairing_delegate_->DisplayPasskey(this, passkey); | 331 if (entered == 0) |
| 332 pairing_delegate_->DisplayPasskey(this, passkey); |
| 333 pairing_delegate_->KeysEntered(this, entered); |
| 336 } | 334 } |
| 337 | 335 |
| 338 void BluetoothDeviceExperimentalChromeOS::RequestConfirmation( | 336 void BluetoothDeviceExperimentalChromeOS::RequestConfirmation( |
| 339 const dbus::ObjectPath& device_path, | 337 const dbus::ObjectPath& device_path, |
| 340 uint32 passkey, | 338 uint32 passkey, |
| 341 const ConfirmationCallback& callback) { | 339 const ConfirmationCallback& callback) { |
| 342 DCHECK(agent_.get()); | 340 DCHECK(agent_.get()); |
| 343 DCHECK(device_path == object_path_); | 341 DCHECK(device_path == object_path_); |
| 344 VLOG(1) << object_path_.value() << ": RequestConfirmation: " << passkey; | 342 VLOG(1) << object_path_.value() << ": RequestConfirmation: " << passkey; |
| 345 | 343 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 if (!confirmation_callback_.is_null()) { | 598 if (!confirmation_callback_.is_null()) { |
| 601 confirmation_callback_.Run(status); | 599 confirmation_callback_.Run(status); |
| 602 confirmation_callback_.Reset(); | 600 confirmation_callback_.Reset(); |
| 603 callback_run = true; | 601 callback_run = true; |
| 604 } | 602 } |
| 605 | 603 |
| 606 return callback_run; | 604 return callback_run; |
| 607 } | 605 } |
| 608 | 606 |
| 609 } // namespace chromeos | 607 } // namespace chromeos |
| OLD | NEW |