summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authordeymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-23 22:09:48 +0000
committerdeymo@chromium.org <deymo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-23 22:09:48 +0000
commit874a8467c0eed9b3d2be78dd1175c888ac7bc3cb (patch)
tree6e843af714750919c022178a98d5db878e227920 /chromeos
parent8c14843b5e2ee88f9d7c090618a75e557b88eef7 (diff)
downloadchromium_src-874a8467c0eed9b3d2be78dd1175c888ac7bc3cb.zip
chromium_src-874a8467c0eed9b3d2be78dd1175c888ac7bc3cb.tar.gz
chromium_src-874a8467c0eed9b3d2be78dd1175c888ac7bc3cb.tar.bz2
Bluetooth: Cache the pairing passkey and pincode in the option handler
This patch persist the value of pairing, pincode, passkey and entered members of the device object sent to the JS UI while updating the pairing overlay. The passkey and pincode values are persisted only when the pairing value implies their existence. This patch also includes a small bugfix in the DBus agent service provider to properly parse the "entered" argument. BUG=233786 TEST=Manual test. Manual test: ============ Take a 2.1 Bluetooth Keyboard (like the Motorola KZ450) and attempt a pairing with it. While typing the passkey in the keyboard, the keys on the screen should change the style as you type them. Note: Typing the wrong key will also highlight the keys on the screen and that's ok. Review URL: https://chromiumcodereview.appspot.com/14036016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/dbus/experimental_bluetooth_agent_service_provider.cc9
-rw-r--r--chromeos/dbus/experimental_bluetooth_agent_service_provider.h2
-rw-r--r--chromeos/dbus/fake_bluetooth_device_client.cc2
-rw-r--r--chromeos/dbus/fake_bluetooth_device_client.h2
4 files changed, 6 insertions, 9 deletions
diff --git a/chromeos/dbus/experimental_bluetooth_agent_service_provider.cc b/chromeos/dbus/experimental_bluetooth_agent_service_provider.cc
index 6501cef..3878df6 100644
--- a/chromeos/dbus/experimental_bluetooth_agent_service_provider.cc
+++ b/chromeos/dbus/experimental_bluetooth_agent_service_provider.cc
@@ -236,18 +236,15 @@ class ExperimentalBluetoothAgentServiceProviderImpl
dbus::MessageReader reader(method_call);
dbus::ObjectPath device_path;
uint32 passkey;
- int16 entered;
+ uint16 entered;
if (!reader.PopObjectPath(&device_path) ||
- !reader.PopUint32(&passkey)) {
+ !reader.PopUint32(&passkey) ||
+ !reader.PopUint16(&entered)) {
LOG(WARNING) << "DisplayPasskey called with incorrect paramters: "
<< method_call->ToString();
return;
}
- // This wasn't always provided, play it safe...
- if (!reader.PopInt16(&entered))
- entered = 0;
-
delegate_->DisplayPasskey(device_path, passkey, entered);
response_sender.Run(dbus::Response::FromMethodCall(method_call));
diff --git a/chromeos/dbus/experimental_bluetooth_agent_service_provider.h b/chromeos/dbus/experimental_bluetooth_agent_service_provider.h
index 414c8db..ff264f9 100644
--- a/chromeos/dbus/experimental_bluetooth_agent_service_provider.h
+++ b/chromeos/dbus/experimental_bluetooth_agent_service_provider.h
@@ -114,7 +114,7 @@ class CHROMEOS_EXPORT ExperimentalBluetoothAgentServiceProvider {
// As the user enters the passkey onto the device, |entered| will be
// updated to reflect the number of digits entered so far.
virtual void DisplayPasskey(const dbus::ObjectPath& device_path,
- uint32 passkey, int16 entered) = 0;
+ uint32 passkey, uint16 entered) = 0;
// This method will be called when the Bluetooth daemon requires that the
// user confirm that the Passkey |passkey| is displayed on the screen
diff --git a/chromeos/dbus/fake_bluetooth_device_client.cc b/chromeos/dbus/fake_bluetooth_device_client.cc
index 46d4ae3..54d39d5 100644
--- a/chromeos/dbus/fake_bluetooth_device_client.cc
+++ b/chromeos/dbus/fake_bluetooth_device_client.cc
@@ -805,7 +805,7 @@ void FakeBluetoothDeviceClient::ConfirmationCallback(
}
void FakeBluetoothDeviceClient::SimulateKeypress(
- int16 entered,
+ uint16 entered,
const dbus::ObjectPath& object_path,
const base::Closure& callback,
const ErrorCallback& error_callback) {
diff --git a/chromeos/dbus/fake_bluetooth_device_client.h b/chromeos/dbus/fake_bluetooth_device_client.h
index 69c2745..861121f 100644
--- a/chromeos/dbus/fake_bluetooth_device_client.h
+++ b/chromeos/dbus/fake_bluetooth_device_client.h
@@ -168,7 +168,7 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient
const ErrorCallback& error_callback,
ExperimentalBluetoothAgentServiceProvider::Delegate::Status status);
void SimulateKeypress(
- int16 entered,
+ uint16 entered,
const dbus::ObjectPath& object_path,
const base::Closure& callback,
const ErrorCallback& error_callback);