summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/nfc_record_client.cc
diff options
context:
space:
mode:
authorarmansito@chromium.org <armansito@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-04 06:27:12 +0000
committerarmansito@chromium.org <armansito@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-04 06:27:12 +0000
commit35dff5af9f8f18b6b3f4716293f4692dfd46629a (patch)
treee7977fc2ed1a79e79d9a9823b96945832f801803 /chromeos/dbus/nfc_record_client.cc
parent2552763077180e820e309ebb3fabd6191ad42a41 (diff)
downloadchromium_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_record_client.cc')
-rw-r--r--chromeos/dbus/nfc_record_client.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/chromeos/dbus/nfc_record_client.cc b/chromeos/dbus/nfc_record_client.cc
index d7bbafd..a24b947 100644
--- a/chromeos/dbus/nfc_record_client.cc
+++ b/chromeos/dbus/nfc_record_client.cc
@@ -186,11 +186,16 @@ class NfcRecordClientImpl : public NfcRecordClient,
// nfc_client_helpers::DBusObjectMap::Delegate override.
virtual NfcPropertySet* CreateProperties(
dbus::ObjectProxy* object_proxy) OVERRIDE {
- return new Properties(
+ Properties* properties = new Properties(
object_proxy,
base::Bind(&NfcRecordClientImpl::OnPropertyChanged,
weak_ptr_factory_.GetWeakPtr(),
object_proxy->object_path()));
+ properties->SetAllPropertiesReceivedCallback(
+ base::Bind(&NfcRecordClientImpl::OnPropertiesReceived,
+ weak_ptr_factory_.GetWeakPtr(),
+ object_proxy->object_path()));
+ return properties;
}
// nfc_client_helpers::DBusObjectMap::Delegate override.
@@ -215,6 +220,14 @@ class NfcRecordClientImpl : public NfcRecordClient,
RecordPropertyChanged(object_path, property_name));
}
+ // Called by NfcPropertySet when all properties have been processed as a
+ // result of a call to GetAll.
+ void OnPropertiesReceived(const dbus::ObjectPath& object_path) {
+ VLOG(1) << "All record properties received; Path: " << object_path.value();
+ FOR_EACH_OBSERVER(NfcRecordClient::Observer, observers_,
+ RecordPropertiesReceived(object_path));
+ }
+
// We maintain a pointer to the bus to be able to request proxies for
// new NFC records that appear.
dbus::Bus* bus_;