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