OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_SHILL_PROFILE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ |
6 #define CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 // ShillProfileClient is used to communicate with the Shill Profile | 34 // ShillProfileClient is used to communicate with the Shill Profile |
35 // service. All methods should be called from the origin thread which | 35 // service. All methods should be called from the origin thread which |
36 // initializes the DBusThreadManager instance. | 36 // initializes the DBusThreadManager instance. |
37 class CHROMEOS_EXPORT ShillProfileClient { | 37 class CHROMEOS_EXPORT ShillProfileClient { |
38 public: | 38 public: |
39 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; | 39 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; |
40 typedef ShillClientHelper::DictionaryValueCallbackWithoutStatus | 40 typedef ShillClientHelper::DictionaryValueCallbackWithoutStatus |
41 DictionaryValueCallbackWithoutStatus; | 41 DictionaryValueCallbackWithoutStatus; |
42 typedef ShillClientHelper::ErrorCallback ErrorCallback; | 42 typedef ShillClientHelper::ErrorCallback ErrorCallback; |
43 | 43 |
44 // Interface for setting up services for testing. Accessed through | |
45 // GetTestInterface(), only implemented in the stub implementation. | |
46 class TestInterface { | |
47 public: | |
48 virtual void AddProfile(const std::string& profile_path) = 0; | |
49 virtual void AddEntry(const std::string& profile_path, | |
50 const std::string& entry_path, | |
51 const base::DictionaryValue& properties) = 0; | |
52 virtual bool AddService(const std::string& service_path) = 0; | |
stevenjb
2013/04/11 18:20:08
nit: blank line
pneubeck (no reviews)
2013/04/15 12:16:24
Done.
| |
53 protected: | |
54 ~TestInterface() {} | |
stevenjb
2013/04/11 18:20:08
virtual
pneubeck (no reviews)
2013/04/15 12:16:24
Done.
| |
55 }; | |
56 | |
44 virtual ~ShillProfileClient(); | 57 virtual ~ShillProfileClient(); |
45 | 58 |
46 // Factory function, creates a new instance which is owned by the caller. | 59 // Factory function, creates a new instance which is owned by the caller. |
47 // For normal usage, access the singleton via DBusThreadManager::Get(). | 60 // For normal usage, access the singleton via DBusThreadManager::Get(). |
48 static ShillProfileClient* Create(DBusClientImplementationType type, | 61 static ShillProfileClient* Create(DBusClientImplementationType type, |
49 dbus::Bus* bus); | 62 dbus::Bus* bus); |
50 | 63 |
51 // Adds a property changed |observer| for the profile at |profile_path|. | 64 // Adds a property changed |observer| for the profile at |profile_path|. |
52 virtual void AddPropertyChangedObserver( | 65 virtual void AddPropertyChangedObserver( |
53 const dbus::ObjectPath& profile_path, | 66 const dbus::ObjectPath& profile_path, |
(...skipping 18 matching lines...) Expand all Loading... | |
72 const DictionaryValueCallbackWithoutStatus& callback, | 85 const DictionaryValueCallbackWithoutStatus& callback, |
73 const ErrorCallback& error_callback) = 0; | 86 const ErrorCallback& error_callback) = 0; |
74 | 87 |
75 // Calls DeleteEntry method. | 88 // Calls DeleteEntry method. |
76 // |callback| is called after the method call succeeds. | 89 // |callback| is called after the method call succeeds. |
77 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, | 90 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, |
78 const std::string& entry_path, | 91 const std::string& entry_path, |
79 const base::Closure& callback, | 92 const base::Closure& callback, |
80 const ErrorCallback& error_callback) = 0; | 93 const ErrorCallback& error_callback) = 0; |
81 | 94 |
95 // Returns an interface for testing (stub only), or returns NULL. | |
96 virtual TestInterface* GetTestInterface() = 0; | |
stevenjb
2013/04/11 18:20:08
blank line
pneubeck (no reviews)
2013/04/15 12:16:24
Done.
| |
82 protected: | 97 protected: |
83 // Create() should be used instead. | 98 // Create() should be used instead. |
84 ShillProfileClient(); | 99 ShillProfileClient(); |
85 | 100 |
86 private: | 101 private: |
87 DISALLOW_COPY_AND_ASSIGN(ShillProfileClient); | 102 DISALLOW_COPY_AND_ASSIGN(ShillProfileClient); |
88 }; | 103 }; |
89 | 104 |
90 } // namespace chromeos | 105 } // namespace chromeos |
91 | 106 |
92 #endif // CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ | 107 #endif // CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ |
OLD | NEW |