| 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_SERVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 public: | 37 public: |
| 38 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; | 38 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; |
| 39 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback; | 39 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback; |
| 40 typedef ShillClientHelper::ListValueCallback ListValueCallback; | 40 typedef ShillClientHelper::ListValueCallback ListValueCallback; |
| 41 typedef ShillClientHelper::ErrorCallback ErrorCallback; | 41 typedef ShillClientHelper::ErrorCallback ErrorCallback; |
| 42 | 42 |
| 43 // Interface for setting up services for testing. Accessed through | 43 // Interface for setting up services for testing. Accessed through |
| 44 // GetTestInterface(), only implemented in the stub implementation. | 44 // GetTestInterface(), only implemented in the stub implementation. |
| 45 class TestInterface { | 45 class TestInterface { |
| 46 public: | 46 public: |
| 47 // Adds a set of default services. Must be called after all Shill | |
| 48 // clients have been created. | |
| 49 virtual void AddDefaultServices() = 0; | |
| 50 | |
| 51 // Adds a Service to the Manager and Service stubs. | 47 // Adds a Service to the Manager and Service stubs. |
| 52 virtual void AddService(const std::string& service_path, | 48 virtual void AddService(const std::string& service_path, |
| 53 const std::string& name, | 49 const std::string& name, |
| 54 const std::string& type, | 50 const std::string& type, |
| 55 const std::string& state, | 51 const std::string& state, |
| 56 bool add_to_visible_list, | 52 bool add_to_visible_list, |
| 57 bool add_to_watch_list) = 0; | 53 bool add_to_watch_list) = 0; |
| 58 virtual void AddServiceWithIPConfig(const std::string& service_path, | 54 virtual void AddServiceWithIPConfig(const std::string& service_path, |
| 59 const std::string& name, | 55 const std::string& name, |
| 60 const std::string& type, | 56 const std::string& type, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 71 const std::string& property, | 67 const std::string& property, |
| 72 const base::Value& value) = 0; | 68 const base::Value& value) = 0; |
| 73 | 69 |
| 74 // Returns properties for |service_path| or NULL if no Service matches. | 70 // Returns properties for |service_path| or NULL if no Service matches. |
| 75 virtual const base::DictionaryValue* GetServiceProperties( | 71 virtual const base::DictionaryValue* GetServiceProperties( |
| 76 const std::string& service_path) const = 0; | 72 const std::string& service_path) const = 0; |
| 77 | 73 |
| 78 // Clears all Services from the Manager and Service stubs. | 74 // Clears all Services from the Manager and Service stubs. |
| 79 virtual void ClearServices() = 0; | 75 virtual void ClearServices() = 0; |
| 80 | 76 |
| 77 virtual void SetConnectBehavior(const std::string& service_path, |
| 78 const base::Closure& behavior) = 0; |
| 79 |
| 81 protected: | 80 protected: |
| 82 virtual ~TestInterface() {} | 81 virtual ~TestInterface() {} |
| 83 }; | 82 }; |
| 84 virtual ~ShillServiceClient(); | 83 virtual ~ShillServiceClient(); |
| 85 | 84 |
| 86 // Factory function, creates a new instance which is owned by the caller. | 85 // Factory function, creates a new instance which is owned by the caller. |
| 87 // For normal usage, access the singleton via DBusThreadManager::Get(). | 86 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| 88 static ShillServiceClient* Create(DBusClientImplementationType type); | 87 static ShillServiceClient* Create(DBusClientImplementationType type); |
| 89 | 88 |
| 90 // Adds a property changed |observer| to the service at |service_path|. | 89 // Adds a property changed |observer| to the service at |service_path|. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Create() should be used instead. | 178 // Create() should be used instead. |
| 180 ShillServiceClient(); | 179 ShillServiceClient(); |
| 181 | 180 |
| 182 private: | 181 private: |
| 183 DISALLOW_COPY_AND_ASSIGN(ShillServiceClient); | 182 DISALLOW_COPY_AND_ASSIGN(ShillServiceClient); |
| 184 }; | 183 }; |
| 185 | 184 |
| 186 } // namespace chromeos | 185 } // namespace chromeos |
| 187 | 186 |
| 188 #endif // CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_H_ | 187 #endif // CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_H_ |
| OLD | NEW |