diff options
author | armansito@chromium.org <armansito@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 06:27:12 +0000 |
---|---|---|
committer | armansito@chromium.org <armansito@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 06:27:12 +0000 |
commit | 35dff5af9f8f18b6b3f4716293f4692dfd46629a (patch) | |
tree | e7977fc2ed1a79e79d9a9823b96945832f801803 /chromeos/dbus/nfc_device_client.cc | |
parent | 2552763077180e820e309ebb3fabd6191ad42a41 (diff) | |
download | chromium_src-35dff5af9f8f18b6b3f4716293f4692dfd46629a.zip chromium_src-35dff5af9f8f18b6b3f4716293f4692dfd46629a.tar.gz chromium_src-35dff5af9f8f18b6b3f4716293f4692dfd46629a.tar.bz2 |
nfc: Various fixes to the NFC D-Bus client in chromeos/dbus.
This CL applies the following fixes:
1. Fixed a bug in chromeos::NfcPropertySet::Set where the code didn't pass
in the property name and value to the D-Bus call.
2. Changed NfcTagClient::Write and NfcDeviceClient::Push to take in a
base::DictionaryValue instead of a map of strings for the NDEF attributes,
as the NDEF record attributes don't have string as their only possible
value type.
3. Fixed a regression in DBusThreadManager due to recent refactors that broke
the NFC client initialization code.
4. Allow users of NfcPropertySet to be notified when a call to GetAll completes.
BUG=316471
TEST=chromeos_unittests
Review URL: https://codereview.chromium.org/99903003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/nfc_device_client.cc')
-rw-r--r-- | chromeos/dbus/nfc_device_client.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chromeos/dbus/nfc_device_client.cc b/chromeos/dbus/nfc_device_client.cc index 4d10d90..a7f691b 100644 --- a/chromeos/dbus/nfc_device_client.cc +++ b/chromeos/dbus/nfc_device_client.cc @@ -69,7 +69,7 @@ class NfcDeviceClientImpl : public NfcDeviceClient, // NfcDeviceClient override. virtual void Push( const dbus::ObjectPath& object_path, - const NfcRecordClient::Attributes& attributes, + const base::DictionaryValue& attributes, const base::Closure& callback, const nfc_client_helpers::ErrorCallback& error_callback) OVERRIDE { dbus::ObjectProxy* object_proxy = @@ -101,11 +101,12 @@ class NfcDeviceClientImpl : public NfcDeviceClient, dbus::MessageWriter array_writer(NULL); dbus::MessageWriter dict_entry_writer(NULL); writer.OpenArray("{sv}", &array_writer); - for (NfcRecordClient::Attributes::const_iterator iter = attributes.begin(); - iter != attributes.end(); ++iter) { + for (DictionaryValue::Iterator iter(attributes); + !iter.IsAtEnd(); iter.Advance()) { array_writer.OpenDictEntry(&dict_entry_writer); - dict_entry_writer.AppendString(iter->first); - dict_entry_writer.AppendVariantOfString(iter->second); + dict_entry_writer.AppendString(iter.key()); + nfc_client_helpers::AppendValueDataAsVariant(&dict_entry_writer, + iter.value()); array_writer.CloseContainer(&dict_entry_writer); } writer.CloseContainer(&array_writer); |