Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: chromeos/dbus/nfc_record_client.cc

Issue 99903003: nfc: Various fixes to the NFC D-Bus client in chromeos/dbus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/nfc_record_client.cc
diff --git a/chromeos/dbus/nfc_record_client.cc b/chromeos/dbus/nfc_record_client.cc
index 753d33fa9c95777e7409e54b55aeaffd430ee074..52573b972bce5e2da2a0480426a6d133ad1db39e 100644
--- a/chromeos/dbus/nfc_record_client.cc
+++ b/chromeos/dbus/nfc_record_client.cc
@@ -187,11 +187,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.
@@ -216,6 +221,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_;

Powered by Google App Engine
This is Rietveld 408576698