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_MANAGER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ |
6 #define CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | |
12 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
13 #include "chromeos/dbus/dbus_client_implementation_type.h" | 12 #include "chromeos/dbus/dbus_client_implementation_type.h" |
| 13 #include "chromeos/dbus/dbus_method_call_status.h" |
14 #include "chromeos/dbus/shill_client_helper.h" | 14 #include "chromeos/dbus/shill_client_helper.h" |
15 | 15 |
16 namespace dbus { | 16 namespace dbus { |
17 | 17 |
18 class Bus; | 18 class Bus; |
| 19 class ObjectPath; |
19 | 20 |
20 } // namespace dbus | 21 } // namespace dbus |
21 | 22 |
22 namespace chromeos { | 23 namespace chromeos { |
23 | 24 |
24 class ShillPropertyChangedObserver; | 25 class ShillPropertyChangedObserver; |
25 | 26 |
26 // ShillManagerClient is used to communicate with the Shill Manager | 27 // ShillManagerClient is used to communicate with the Shill Manager |
27 // service. All methods should be called from the origin thread which | 28 // service. All methods should be called from the origin thread which |
28 // initializes the DBusThreadManager instance. | 29 // initializes the DBusThreadManager instance. |
(...skipping 21 matching lines...) Expand all Loading... |
50 virtual void ClearServices() = 0; | 51 virtual void ClearServices() = 0; |
51 virtual void AddTechnology(const std::string& type, bool enabled) = 0; | 52 virtual void AddTechnology(const std::string& type, bool enabled) = 0; |
52 virtual void RemoveTechnology(const std::string& type) = 0; | 53 virtual void RemoveTechnology(const std::string& type) = 0; |
53 virtual void AddGeoNetwork(const std::string& technology, | 54 virtual void AddGeoNetwork(const std::string& technology, |
54 const base::DictionaryValue& network) = 0; | 55 const base::DictionaryValue& network) = 0; |
55 | 56 |
56 // Used to reset all properties; does not notify observers. | 57 // Used to reset all properties; does not notify observers. |
57 virtual void ClearProperties() = 0; | 58 virtual void ClearProperties() = 0; |
58 | 59 |
59 protected: | 60 protected: |
60 ~TestInterface() {} | 61 virtual ~TestInterface() {} |
61 }; | 62 }; |
62 | 63 |
63 virtual ~ShillManagerClient(); | 64 virtual ~ShillManagerClient(); |
64 | 65 |
65 // Factory function, creates a new instance which is owned by the caller. | 66 // Factory function, creates a new instance which is owned by the caller. |
66 // For normal usage, access the singleton via DBusThreadManager::Get(). | 67 // For normal usage, access the singleton via DBusThreadManager::Get(). |
67 static ShillManagerClient* Create(DBusClientImplementationType type, | 68 static ShillManagerClient* Create(DBusClientImplementationType type, |
68 dbus::Bus* bus); | 69 dbus::Bus* bus); |
69 | 70 |
70 // Adds a property changed |observer|. | 71 // Adds a property changed |observer|. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 virtual void DisableTechnology(const std::string& type, | 117 virtual void DisableTechnology(const std::string& type, |
117 const base::Closure& callback, | 118 const base::Closure& callback, |
118 const ErrorCallback& error_callback) = 0; | 119 const ErrorCallback& error_callback) = 0; |
119 | 120 |
120 // Calls ConfigureService method. | 121 // Calls ConfigureService method. |
121 // |callback| is called after the method call succeeds. | 122 // |callback| is called after the method call succeeds. |
122 virtual void ConfigureService(const base::DictionaryValue& properties, | 123 virtual void ConfigureService(const base::DictionaryValue& properties, |
123 const ObjectPathCallback& callback, | 124 const ObjectPathCallback& callback, |
124 const ErrorCallback& error_callback) = 0; | 125 const ErrorCallback& error_callback) = 0; |
125 | 126 |
| 127 // Calls ConfigureServiceForProfile method. |
| 128 // |callback| is called with the created service if the method call succeeds. |
| 129 virtual void ConfigureServiceForProfile( |
| 130 const dbus::ObjectPath& profile_path, |
| 131 const base::DictionaryValue& properties, |
| 132 const ObjectPathCallback& callback, |
| 133 const ErrorCallback& error_callback) = 0; |
| 134 |
126 // Calls GetService method. | 135 // Calls GetService method. |
127 // |callback| is called after the method call succeeds. | 136 // |callback| is called after the method call succeeds. |
128 virtual void GetService(const base::DictionaryValue& properties, | 137 virtual void GetService(const base::DictionaryValue& properties, |
129 const ObjectPathCallback& callback, | 138 const ObjectPathCallback& callback, |
130 const ErrorCallback& error_callback) = 0; | 139 const ErrorCallback& error_callback) = 0; |
131 | 140 |
132 // Verify that the given data corresponds to a trusted device, and return true | 141 // Verify that the given data corresponds to a trusted device, and return true |
133 // to the callback if it is. | 142 // to the callback if it is. |
134 virtual void VerifyDestination(const std::string& certificate, | 143 virtual void VerifyDestination(const std::string& certificate, |
135 const std::string& public_key, | 144 const std::string& public_key, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Create() should be used instead. | 187 // Create() should be used instead. |
179 ShillManagerClient(); | 188 ShillManagerClient(); |
180 | 189 |
181 private: | 190 private: |
182 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); | 191 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); |
183 }; | 192 }; |
184 | 193 |
185 } // namespace chromeos | 194 } // namespace chromeos |
186 | 195 |
187 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ | 196 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ |
OLD | NEW |