| 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" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; | 31 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; |
| 32 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback; | 32 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback; |
| 33 typedef ShillClientHelper::ErrorCallback ErrorCallback; | 33 typedef ShillClientHelper::ErrorCallback ErrorCallback; |
| 34 | 34 |
| 35 // Interface for setting up devices, services, and technologies for testing. | 35 // Interface for setting up devices, services, and technologies for testing. |
| 36 // Accessed through GetTestInterface(), only implemented in the Stub Impl. | 36 // Accessed through GetTestInterface(), only implemented in the Stub Impl. |
| 37 class TestInterface { | 37 class TestInterface { |
| 38 public: | 38 public: |
| 39 virtual void AddDevice(const std::string& device_path) = 0; | 39 virtual void AddDevice(const std::string& device_path) = 0; |
| 40 virtual void RemoveDevice(const std::string& device_path) = 0; | 40 virtual void RemoveDevice(const std::string& device_path) = 0; |
| 41 virtual void ResetDevices() = 0; |
| 41 virtual void AddService(const std::string& service_path, | 42 virtual void AddService(const std::string& service_path, |
| 42 bool add_to_watch_list) = 0; | 43 bool add_to_watch_list) = 0; |
| 43 virtual void AddServiceAtIndex(const std::string& service_path, | 44 virtual void AddServiceAtIndex(const std::string& service_path, |
| 44 size_t index, | 45 size_t index, |
| 45 bool add_to_watch_list) = 0; | 46 bool add_to_watch_list) = 0; |
| 46 virtual void RemoveService(const std::string& service_path) = 0; | 47 virtual void RemoveService(const std::string& service_path) = 0; |
| 47 virtual void AddTechnology(const std::string& type, bool enabled) = 0; | 48 virtual void AddTechnology(const std::string& type, bool enabled) = 0; |
| 48 virtual void RemoveTechnology(const std::string& type) = 0; | 49 virtual void RemoveTechnology(const std::string& type) = 0; |
| 50 virtual void AddGeoNetwork(const std::string& technology, |
| 51 const base::DictionaryValue& network) = 0; |
| 49 | 52 |
| 50 // Used to reset all properties; does not notify observers. | 53 // Used to reset all properties; does not notify observers. |
| 51 virtual void ClearProperties() = 0; | 54 virtual void ClearProperties() = 0; |
| 52 | 55 |
| 53 protected: | 56 protected: |
| 54 ~TestInterface() {} | 57 ~TestInterface() {} |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 virtual ~ShillManagerClient(); | 60 virtual ~ShillManagerClient(); |
| 58 | 61 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 70 ShillPropertyChangedObserver* observer) = 0; | 73 ShillPropertyChangedObserver* observer) = 0; |
| 71 | 74 |
| 72 // Calls GetProperties method. | 75 // Calls GetProperties method. |
| 73 // |callback| is called after the method call succeeds. | 76 // |callback| is called after the method call succeeds. |
| 74 virtual void GetProperties(const DictionaryValueCallback& callback) = 0; | 77 virtual void GetProperties(const DictionaryValueCallback& callback) = 0; |
| 75 | 78 |
| 76 // DEPRECATED DO NOT USE: Calls GetProperties method and blocks until the | 79 // DEPRECATED DO NOT USE: Calls GetProperties method and blocks until the |
| 77 // method call finishes. The caller is responsible to delete the result. | 80 // method call finishes. The caller is responsible to delete the result. |
| 78 // Thie method returns NULL when method call fails. | 81 // Thie method returns NULL when method call fails. |
| 79 // | 82 // |
| 80 // TODO(hashimoto): Refactor CrosGetWifiAccessPoints and remove this method. | 83 // TODO(hashimoto): Refactor blocking calls and remove this method. |
| 81 // crosbug.com/29902 | 84 // crosbug.com/29902 |
| 82 virtual base::DictionaryValue* CallGetPropertiesAndBlock() = 0; | 85 virtual base::DictionaryValue* CallGetPropertiesAndBlock() = 0; |
| 83 | 86 |
| 87 // Calls GetNetworksForGeolocation method. |
| 88 // |callback| is called after the method call succeeds. |
| 89 virtual void GetNetworksForGeolocation( |
| 90 const DictionaryValueCallback& callback) = 0; |
| 91 |
| 84 // Calls SetProperty method. | 92 // Calls SetProperty method. |
| 85 // |callback| is called after the method call succeeds. | 93 // |callback| is called after the method call succeeds. |
| 86 virtual void SetProperty(const std::string& name, | 94 virtual void SetProperty(const std::string& name, |
| 87 const base::Value& value, | 95 const base::Value& value, |
| 88 const base::Closure& callback, | 96 const base::Closure& callback, |
| 89 const ErrorCallback& error_callback) = 0; | 97 const ErrorCallback& error_callback) = 0; |
| 90 | 98 |
| 91 // Calls RequestScan method. | 99 // Calls RequestScan method. |
| 92 // |callback| is called after the method call succeeds. | 100 // |callback| is called after the method call succeeds. |
| 93 virtual void RequestScan(const std::string& type, | 101 virtual void RequestScan(const std::string& type, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Create() should be used instead. | 133 // Create() should be used instead. |
| 126 ShillManagerClient(); | 134 ShillManagerClient(); |
| 127 | 135 |
| 128 private: | 136 private: |
| 129 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); | 137 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); |
| 130 }; | 138 }; |
| 131 | 139 |
| 132 } // namespace chromeos | 140 } // namespace chromeos |
| 133 | 141 |
| 134 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ | 142 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ |
| OLD | NEW |