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