OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_DBUS_FLIMFLAM_PROFILE_CLIENT_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_DBUS_FLIMFLAM_PROFILE_CLIENT_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/callback.h" | |
12 #include "chrome/browser/chromeos/dbus/dbus_client_implementation_type.h" | |
13 #include "chrome/browser/chromeos/dbus/flimflam_client_helper.h" | |
14 | |
15 namespace base { | |
16 | |
17 class Value; | |
18 class DictionaryValue; | |
19 | |
20 } // namespace base | |
21 | |
22 namespace dbus { | |
23 | |
24 class Bus; | |
25 class ObjectPath; | |
26 | |
27 } // namespace dbus | |
28 | |
29 namespace chromeos { | |
30 | |
31 // FlimflamProfileClient is used to communicate with the Flimflam Profile | |
32 // service. All methods should be called from the origin thread which | |
33 // initializes the DBusThreadManager instance. | |
34 class FlimflamProfileClient { | |
35 public: | |
36 typedef FlimflamClientHelper::PropertyChangedHandler PropertyChangedHandler; | |
37 typedef FlimflamClientHelper::VoidCallback VoidCallback; | |
38 typedef FlimflamClientHelper::DictionaryValueCallback DictionaryValueCallback; | |
39 | |
40 virtual ~FlimflamProfileClient(); | |
41 | |
42 // Factory function, creates a new instance which is owned by the caller. | |
43 // For normal usage, access the singleton via DBusThreadManager::Get(). | |
44 static FlimflamProfileClient* Create(DBusClientImplementationType type, | |
45 dbus::Bus* bus); | |
46 | |
47 // Sets PropertyChanged signal handler. | |
48 virtual void SetPropertyChangedHandler( | |
49 const PropertyChangedHandler& handler) = 0; | |
50 | |
51 // Resets PropertyChanged signal handler. | |
52 virtual void ResetPropertyChangedHandler() = 0; | |
53 | |
54 // Calls GetProperties method. | |
55 // |callback| is called after the method call succeeds. | |
56 virtual void GetProperties(const DictionaryValueCallback& callback) = 0; | |
57 | |
58 // Calls GetEntry method. | |
59 // |callback| is called after the method call succeeds. | |
60 virtual void GetEntry(const dbus::ObjectPath& path, | |
61 const DictionaryValueCallback& callback) = 0; | |
62 | |
63 // Calls DeleteEntry method. | |
64 // |callback| is called after the method call succeeds. | |
65 virtual void DeleteEntry(const dbus::ObjectPath& path, | |
66 const VoidCallback& callback) = 0; | |
67 | |
68 protected: | |
69 // Create() should be used instead. | |
70 FlimflamProfileClient(); | |
71 | |
72 private: | |
73 DISALLOW_COPY_AND_ASSIGN(FlimflamProfileClient); | |
74 }; | |
75 | |
76 } // namespace chromeos | |
77 | |
78 #endif // CHROME_BROWSER_CHROMEOS_DBUS_FLIMFLAM_PROFILE_CLIENT_H_ | |
OLD | NEW |