diff options
Diffstat (limited to 'chromeos/dbus/nfc_record_client.cc')
-rw-r--r-- | chromeos/dbus/nfc_record_client.cc | 15 |
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_; |