| 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_DEVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_DEVICE_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_SHILL_DEVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SHILL_DEVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 #include "chromeos/dbus/dbus_client.h" | 13 #include "chromeos/dbus/dbus_client.h" |
| 14 #include "chromeos/dbus/shill_client_helper.h" | 14 #include "chromeos/dbus/shill_client_helper.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 | 17 |
| 18 class Value; | 18 class Value; |
| 19 class DictionaryValue; | 19 class DictionaryValue; |
| 20 | 20 |
| 21 } // namespace base | 21 } // namespace base |
| 22 | 22 |
| 23 namespace dbus { | 23 namespace dbus { |
| 24 | 24 |
| 25 class ObjectPath; | 25 class ObjectPath; |
| 26 | 26 |
| 27 } // namespace dbus | 27 } // namespace dbus |
| 28 | 28 |
| 29 namespace net { |
| 30 |
| 31 class IPEndPoint; |
| 32 |
| 33 } // namespace net |
| 34 |
| 29 namespace chromeos { | 35 namespace chromeos { |
| 30 | 36 |
| 31 class ShillPropertyChangedObserver; | 37 class ShillPropertyChangedObserver; |
| 32 | 38 |
| 33 // ShillDeviceClient is used to communicate with the Shill Device service. | 39 // ShillDeviceClient is used to communicate with the Shill Device service. |
| 34 // All methods should be called from the origin thread which initializes the | 40 // All methods should be called from the origin thread which initializes the |
| 35 // DBusThreadManager instance. | 41 // DBusThreadManager instance. |
| 36 class CHROMEOS_EXPORT ShillDeviceClient : public DBusClient { | 42 class CHROMEOS_EXPORT ShillDeviceClient : public DBusClient { |
| 37 public: | 43 public: |
| 38 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; | 44 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 const ErrorCallback& error_callback) = 0; | 162 const ErrorCallback& error_callback) = 0; |
| 157 | 163 |
| 158 // Calls the PerformTDLSOperation method. | 164 // Calls the PerformTDLSOperation method. |
| 159 // |callback| is called after the method call finishes. | 165 // |callback| is called after the method call finishes. |
| 160 virtual void PerformTDLSOperation(const dbus::ObjectPath& device_path, | 166 virtual void PerformTDLSOperation(const dbus::ObjectPath& device_path, |
| 161 const std::string& operation, | 167 const std::string& operation, |
| 162 const std::string& peer, | 168 const std::string& peer, |
| 163 const StringCallback& callback, | 169 const StringCallback& callback, |
| 164 const ErrorCallback& error_callback) = 0; | 170 const ErrorCallback& error_callback) = 0; |
| 165 | 171 |
| 172 // Adds |ip_endpoint| to the list of tcp connections that the device should |
| 173 // monitor to wake the system from suspend. |
| 174 virtual void AddWakeOnPacketConnection( |
| 175 const dbus::ObjectPath& device_path, |
| 176 const net::IPEndPoint& ip_endpoint, |
| 177 const base::Closure& callback, |
| 178 const ErrorCallback& error_callback) = 0; |
| 179 |
| 180 // Removes |ip_endpoint| from the list of tcp connections that the device |
| 181 // should monitor to wake the system from suspend. |
| 182 virtual void RemoveWakeOnPacketConnection( |
| 183 const dbus::ObjectPath& device_path, |
| 184 const net::IPEndPoint& ip_endpoint, |
| 185 const base::Closure& callback, |
| 186 const ErrorCallback& error_callback) = 0; |
| 187 |
| 188 // Clears the list of tcp connections that the device should monitor to wake |
| 189 // the system from suspend. |
| 190 virtual void RemoveAllWakeOnPacketConnections( |
| 191 const dbus::ObjectPath& device_path, |
| 192 const base::Closure& callback, |
| 193 const ErrorCallback& error_callback) = 0; |
| 194 |
| 166 // Returns an interface for testing (stub only), or returns NULL. | 195 // Returns an interface for testing (stub only), or returns NULL. |
| 167 virtual TestInterface* GetTestInterface() = 0; | 196 virtual TestInterface* GetTestInterface() = 0; |
| 168 | 197 |
| 169 protected: | 198 protected: |
| 170 friend class ShillDeviceClientTest; | 199 friend class ShillDeviceClientTest; |
| 171 | 200 |
| 172 // Create() should be used instead. | 201 // Create() should be used instead. |
| 173 ShillDeviceClient(); | 202 ShillDeviceClient(); |
| 174 | 203 |
| 175 private: | 204 private: |
| 176 DISALLOW_COPY_AND_ASSIGN(ShillDeviceClient); | 205 DISALLOW_COPY_AND_ASSIGN(ShillDeviceClient); |
| 177 }; | 206 }; |
| 178 | 207 |
| 179 } // namespace chromeos | 208 } // namespace chromeos |
| 180 | 209 |
| 181 #endif // CHROMEOS_DBUS_SHILL_DEVICE_CLIENT_H_ | 210 #endif // CHROMEOS_DBUS_SHILL_DEVICE_CLIENT_H_ |
| OLD | NEW |