| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/nfc_record_client.h" | 5 #include "chromeos/dbus/nfc_record_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "chromeos/dbus/nfc_device_client.h" | 10 #include "chromeos/dbus/nfc_device_client.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 VLOG(1) << "All record properties received; Path: " << object_path.value(); | 237 VLOG(1) << "All record properties received; Path: " << object_path.value(); |
| 238 FOR_EACH_OBSERVER(NfcRecordClient::Observer, observers_, | 238 FOR_EACH_OBSERVER(NfcRecordClient::Observer, observers_, |
| 239 RecordPropertiesReceived(object_path)); | 239 RecordPropertiesReceived(object_path)); |
| 240 } | 240 } |
| 241 | 241 |
| 242 // We maintain a pointer to the bus to be able to request proxies for | 242 // We maintain a pointer to the bus to be able to request proxies for |
| 243 // new NFC records that appear. | 243 // new NFC records that appear. |
| 244 dbus::Bus* bus_; | 244 dbus::Bus* bus_; |
| 245 | 245 |
| 246 // List of observers interested in event notifications. | 246 // List of observers interested in event notifications. |
| 247 ObserverList<NfcRecordClient::Observer> observers_; | 247 base::ObserverList<NfcRecordClient::Observer> observers_; |
| 248 | 248 |
| 249 // Mapping from object paths to object proxies and properties structures that | 249 // Mapping from object paths to object proxies and properties structures that |
| 250 // were already created by us. Record objects belong to either Tag or Device | 250 // were already created by us. Record objects belong to either Tag or Device |
| 251 // objects. This structure stores a different DBusObjectMap for each known | 251 // objects. This structure stores a different DBusObjectMap for each known |
| 252 // device and tag. | 252 // device and tag. |
| 253 ObjectProxyTree devices_and_tags_to_object_maps_; | 253 ObjectProxyTree devices_and_tags_to_object_maps_; |
| 254 | 254 |
| 255 // The device and tag clients that we listen to events notifications from. | 255 // The device and tag clients that we listen to events notifications from. |
| 256 NfcDeviceClient* device_client_; | 256 NfcDeviceClient* device_client_; |
| 257 NfcTagClient* tag_client_; | 257 NfcTagClient* tag_client_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 269 | 269 |
| 270 NfcRecordClient::~NfcRecordClient() { | 270 NfcRecordClient::~NfcRecordClient() { |
| 271 } | 271 } |
| 272 | 272 |
| 273 NfcRecordClient* NfcRecordClient::Create(NfcDeviceClient* device_client, | 273 NfcRecordClient* NfcRecordClient::Create(NfcDeviceClient* device_client, |
| 274 NfcTagClient* tag_client) { | 274 NfcTagClient* tag_client) { |
| 275 return new NfcRecordClientImpl(device_client, tag_client); | 275 return new NfcRecordClientImpl(device_client, tag_client); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace chromeos | 278 } // namespace chromeos |
| OLD | NEW |