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

Side by Side Diff: chromeos/dbus/nfc_property_set.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROMEOS_DBUS_NFC_PROPERTY_SET_H_ 5 #ifndef CHROMEOS_DBUS_NFC_PROPERTY_SET_H_
6 #define CHROMEOS_DBUS_NFC_PROPERTY_SET_H_ 6 #define CHROMEOS_DBUS_NFC_PROPERTY_SET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h"
10 #include "dbus/message.h" 11 #include "dbus/message.h"
11 #include "dbus/object_proxy.h" 12 #include "dbus/object_proxy.h"
12 #include "dbus/property.h" 13 #include "dbus/property.h"
13 14
14 namespace chromeos { 15 namespace chromeos {
15 16
16 // neard doesn't use the standard D-Bus interfaces for property access and 17 // neard doesn't use the standard D-Bus interfaces for property access and
17 // instead defines property accessor methods in each D-Bus interface. This 18 // instead defines property accessor methods in each D-Bus interface. This
18 // class customizes dbus::PropertySet to generate the correct method call to 19 // class customizes dbus::PropertySet to generate the correct method call to
19 // get all properties, connect to the correct signal and parse it correctly. 20 // get all properties, connect to the correct signal and parse it correctly.
20 class NfcPropertySet : public dbus::PropertySet { 21 class NfcPropertySet : public dbus::PropertySet {
21 public: 22 public:
22 NfcPropertySet(dbus::ObjectProxy* object_proxy, 23 NfcPropertySet(dbus::ObjectProxy* object_proxy,
23 const std::string& interface, 24 const std::string& interface,
24 const PropertyChangedCallback& callback); 25 const PropertyChangedCallback& callback);
25 26
27 // Caches |callback| so that it will be invoked after a call to GetAll()
28 // has successfully received all existing properties from the remote object.
29 void SetAllPropertiesReceivedCallback(const base::Closure& callback);
30
26 // dbus::PropertySet overrides 31 // dbus::PropertySet overrides
27 virtual void ConnectSignals() OVERRIDE; 32 virtual void ConnectSignals() OVERRIDE;
28 virtual void Get(dbus::PropertyBase* property, 33 virtual void Get(dbus::PropertyBase* property,
29 GetCallback callback) OVERRIDE; 34 GetCallback callback) OVERRIDE;
30 virtual void GetAll() OVERRIDE; 35 virtual void GetAll() OVERRIDE;
36 virtual void OnGetAll(dbus::Response* response) OVERRIDE;
31 virtual void Set(dbus::PropertyBase* property, 37 virtual void Set(dbus::PropertyBase* property,
32 SetCallback callback) OVERRIDE; 38 SetCallback callback) OVERRIDE;
33 virtual void ChangedReceived(dbus::Signal* signal) OVERRIDE; 39 virtual void ChangedReceived(dbus::Signal* signal) OVERRIDE;
34 40
35 private: 41 private:
42 // Optional callback used to notify clients when all properties were received
43 // after a call to GetAll.
44 base::Closure on_get_all_callback_;
45
36 DISALLOW_COPY_AND_ASSIGN(NfcPropertySet); 46 DISALLOW_COPY_AND_ASSIGN(NfcPropertySet);
37 }; 47 };
38 48
39 } // namespace chromeos 49 } // namespace chromeos
40 50
41 #endif // CHROMEOS_DBUS_NFC_PROPERTY_SET_H_ 51 #endif // CHROMEOS_DBUS_NFC_PROPERTY_SET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698