| 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 "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
| 12 #include "chromeos/dbus/dbus_client.h" | 12 #include "chromeos/dbus/dbus_client.h" |
| 13 #include "chromeos/dbus/dbus_method_call_status.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 class ObjectPath; | 18 class ObjectPath; |
| 18 } | |
| 19 | 19 |
| 20 namespace net { | 20 } // namespace dbus |
| 21 class IPEndPoint; | |
| 22 } | |
| 23 | 21 |
| 24 namespace chromeos { | 22 namespace chromeos { |
| 25 | 23 |
| 26 class ShillPropertyChangedObserver; | 24 class ShillPropertyChangedObserver; |
| 27 | 25 |
| 28 // ShillManagerClient is used to communicate with the Shill Manager | 26 // ShillManagerClient is used to communicate with the Shill Manager |
| 29 // service. All methods should be called from the origin thread which | 27 // service. All methods should be called from the origin thread which |
| 30 // initializes the DBusThreadManager instance. | 28 // initializes the DBusThreadManager instance. |
| 31 class CHROMEOS_EXPORT ShillManagerClient : public DBusClient { | 29 class CHROMEOS_EXPORT ShillManagerClient : public DBusClient { |
| 32 public: | 30 public: |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 const base::DictionaryValue& properties, | 186 const base::DictionaryValue& properties, |
| 189 const ObjectPathCallback& callback, | 187 const ObjectPathCallback& callback, |
| 190 const ErrorCallback& error_callback) = 0; | 188 const ErrorCallback& error_callback) = 0; |
| 191 | 189 |
| 192 // Calls GetService method. | 190 // Calls GetService method. |
| 193 // |callback| is called after the method call succeeds. | 191 // |callback| is called after the method call succeeds. |
| 194 virtual void GetService(const base::DictionaryValue& properties, | 192 virtual void GetService(const base::DictionaryValue& properties, |
| 195 const ObjectPathCallback& callback, | 193 const ObjectPathCallback& callback, |
| 196 const ErrorCallback& error_callback) = 0; | 194 const ErrorCallback& error_callback) = 0; |
| 197 | 195 |
| 198 // Verifies that the given data corresponds to a trusted device, and returns | 196 // Verify that the given data corresponds to a trusted device, and return true |
| 199 // true to the callback if it is. | 197 // to the callback if it is. |
| 200 virtual void VerifyDestination(const VerificationProperties& properties, | 198 virtual void VerifyDestination(const VerificationProperties& properties, |
| 201 const BooleanCallback& callback, | 199 const BooleanCallback& callback, |
| 202 const ErrorCallback& error_callback) = 0; | 200 const ErrorCallback& error_callback) = 0; |
| 203 | 201 |
| 204 // Verifies that the given data corresponds to a trusted device, and if it is, | 202 // Verify that the given data corresponds to a trusted device, and if it is, |
| 205 // returns the encrypted credentials for connecting to the network represented | 203 // return the encrypted credentials for connecting to the network represented |
| 206 // by the given |service_path|, encrypted using the |public_key| for the | 204 // by the given |service_path|, encrypted using the |public_key| for the |
| 207 // trusted device. If the device is not trusted, returns the empty string. | 205 // trusted device. If the device is not trusted, return the empty string. |
| 208 virtual void VerifyAndEncryptCredentials( | 206 virtual void VerifyAndEncryptCredentials( |
| 209 const VerificationProperties& properties, | 207 const VerificationProperties& properties, |
| 210 const std::string& service_path, | 208 const std::string& service_path, |
| 211 const StringCallback& callback, | 209 const StringCallback& callback, |
| 212 const ErrorCallback& error_callback) = 0; | 210 const ErrorCallback& error_callback) = 0; |
| 213 | 211 |
| 214 // Verifies that the given data corresponds to a trusted device, and returns | 212 // Verify that the given data corresponds to a trusted device, and return the |
| 215 // the |data| encrypted using the |public_key| for the trusted device. If the | 213 // |data| encrypted using the |public_key| for the trusted device. If the |
| 216 // device is not trusted, returns the empty string. | 214 // device is not trusted, return the empty string. |
| 217 virtual void VerifyAndEncryptData(const VerificationProperties& properties, | 215 virtual void VerifyAndEncryptData(const VerificationProperties& properties, |
| 218 const std::string& data, | 216 const std::string& data, |
| 219 const StringCallback& callback, | 217 const StringCallback& callback, |
| 220 const ErrorCallback& error_callback) = 0; | 218 const ErrorCallback& error_callback) = 0; |
| 221 | 219 |
| 222 // For each technology present, connects to the "best" service available. | 220 // For each technology present, connect to the "best" service available. |
| 223 // Called once the user is logged in and certificates are loaded. | 221 // Called once the user is logged in and certificates are loaded. |
| 224 virtual void ConnectToBestServices(const base::Closure& callback, | 222 virtual void ConnectToBestServices(const base::Closure& callback, |
| 225 const ErrorCallback& error_callback) = 0; | 223 const ErrorCallback& error_callback) = 0; |
| 226 | 224 |
| 227 // Requests that shill program the NIC so that packets incoming on | |
| 228 // |ip_connection| wake up the CPU. | |
| 229 virtual void AddWakeOnPacketConnection( | |
| 230 const net::IPEndPoint& ip_endpoint, | |
| 231 const base::Closure& callback, | |
| 232 const ErrorCallback& error_callback) = 0; | |
| 233 | |
| 234 // Removes a request to wake up on packets coming on |ip_connection|. | |
| 235 virtual void RemoveWakeOnPacketConnection( | |
| 236 const net::IPEndPoint& ip_endpoint, | |
| 237 const base::Closure& callback, | |
| 238 const ErrorCallback& error_callback) = 0; | |
| 239 | |
| 240 // Clears all requests to wake up on packets. | |
| 241 virtual void RemoveAllWakeOnPacketConnections( | |
| 242 const base::Closure& callback, | |
| 243 const ErrorCallback& error_callback) = 0; | |
| 244 | |
| 245 // Returns an interface for testing (stub only), or returns NULL. | 225 // Returns an interface for testing (stub only), or returns NULL. |
| 246 virtual TestInterface* GetTestInterface() = 0; | 226 virtual TestInterface* GetTestInterface() = 0; |
| 247 | 227 |
| 248 protected: | 228 protected: |
| 249 friend class ShillManagerClientTest; | 229 friend class ShillManagerClientTest; |
| 250 | 230 |
| 251 // Create() should be used instead. | 231 // Create() should be used instead. |
| 252 ShillManagerClient(); | 232 ShillManagerClient(); |
| 253 | 233 |
| 254 private: | 234 private: |
| 255 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); | 235 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); |
| 256 }; | 236 }; |
| 257 | 237 |
| 258 } // namespace chromeos | 238 } // namespace chromeos |
| 259 | 239 |
| 260 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ | 240 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ |
| OLD | NEW |