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

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

Issue 2292703002: chromeos: Remove unused NFC D-Bus client library (Closed)
Patch Set: rebase Created 4 years, 3 months 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
« no previous file with comments | « chromeos/dbus/nfc_manager_client.cc ('k') | chromeos/dbus/nfc_property_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROMEOS_DBUS_NFC_PROPERTY_SET_H_
6 #define CHROMEOS_DBUS_NFC_PROPERTY_SET_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "dbus/message.h"
13 #include "dbus/object_proxy.h"
14 #include "dbus/property.h"
15
16 namespace chromeos {
17
18 // neard doesn't use the standard D-Bus interfaces for property access and
19 // instead defines property accessor methods in each D-Bus interface. This
20 // class customizes dbus::PropertySet to generate the correct method call to
21 // get all properties, connect to the correct signal and parse it correctly.
22 class NfcPropertySet : public dbus::PropertySet {
23 public:
24 NfcPropertySet(dbus::ObjectProxy* object_proxy,
25 const std::string& interface,
26 const PropertyChangedCallback& callback);
27
28 // Destructor; we don't hold on to any references or memory that needs
29 // explicit clean-up, but clang thinks we might.
30 ~NfcPropertySet() override;
31
32 // Caches |callback| so that it will be invoked after a call to GetAll()
33 // has successfully received all existing properties from the remote object.
34 void SetAllPropertiesReceivedCallback(const base::Closure& callback);
35
36 // dbus::PropertySet overrides
37 void ConnectSignals() override;
38 void Get(dbus::PropertyBase* property, GetCallback callback) override;
39 void GetAll() override;
40 void OnGetAll(dbus::Response* response) override;
41 void Set(dbus::PropertyBase* property, SetCallback callback) override;
42 void ChangedReceived(dbus::Signal* signal) override;
43
44 protected:
45 const base::Closure& on_get_all_callback() { return on_get_all_callback_; }
46
47 private:
48 void OnGetAllError(dbus::ErrorResponse* response);
49
50 // Optional callback used to notify clients when all properties were received
51 // after a call to GetAll.
52 base::Closure on_get_all_callback_;
53
54 base::WeakPtrFactory<NfcPropertySet> weak_ptr_factory_;
55
56 DISALLOW_COPY_AND_ASSIGN(NfcPropertySet);
57 };
58
59 } // namespace chromeos
60
61 #endif // CHROMEOS_DBUS_NFC_PROPERTY_SET_H_
OLDNEW
« no previous file with comments | « chromeos/dbus/nfc_manager_client.cc ('k') | chromeos/dbus/nfc_property_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698