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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 323 } |
324 | 324 |
325 void BluetoothDeviceExperimentalChromeOS::DisplayPasskey( | 325 void BluetoothDeviceExperimentalChromeOS::DisplayPasskey( |
326 const dbus::ObjectPath& device_path, | 326 const dbus::ObjectPath& device_path, |
327 uint32 passkey, int16 entered) { | 327 uint32 passkey, int16 entered) { |
328 DCHECK(agent_.get()); | 328 DCHECK(agent_.get()); |
329 DCHECK(device_path == object_path_); | 329 DCHECK(device_path == object_path_); |
330 VLOG(1) << object_path_.value() << ": DisplayPasskey: " << passkey | 330 VLOG(1) << object_path_.value() << ": DisplayPasskey: " << passkey |
331 << " (" << entered << " entered)"; | 331 << " (" << entered << " entered)"; |
332 | 332 |
333 // TODO(keybuk): disambiguate entered vs display | |
334 if (entered > 0) | |
335 return; | |
336 | |
337 DCHECK(pairing_delegate_); | 333 DCHECK(pairing_delegate_); |
338 pairing_delegate_->DisplayPasskey(this, passkey); | 334 if (entered == 0) |
| 335 pairing_delegate_->DisplayPasskey(this, passkey); |
| 336 pairing_delegate_->KeysEntered(this, entered); |
339 } | 337 } |
340 | 338 |
341 void BluetoothDeviceExperimentalChromeOS::RequestConfirmation( | 339 void BluetoothDeviceExperimentalChromeOS::RequestConfirmation( |
342 const dbus::ObjectPath& device_path, | 340 const dbus::ObjectPath& device_path, |
343 uint32 passkey, | 341 uint32 passkey, |
344 const ConfirmationCallback& callback) { | 342 const ConfirmationCallback& callback) { |
345 DCHECK(agent_.get()); | 343 DCHECK(agent_.get()); |
346 DCHECK(device_path == object_path_); | 344 DCHECK(device_path == object_path_); |
347 VLOG(1) << object_path_.value() << ": RequestConfirmation: " << passkey; | 345 VLOG(1) << object_path_.value() << ": RequestConfirmation: " << passkey; |
348 | 346 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 if (!confirmation_callback_.is_null()) { | 603 if (!confirmation_callback_.is_null()) { |
606 confirmation_callback_.Run(status); | 604 confirmation_callback_.Run(status); |
607 confirmation_callback_.Reset(); | 605 confirmation_callback_.Reset(); |
608 callback_run = true; | 606 callback_run = true; |
609 } | 607 } |
610 | 608 |
611 return callback_run; | 609 return callback_run; |
612 } | 610 } |
613 | 611 |
614 } // namespace chromeos | 612 } // namespace chromeos |
OLD | NEW |