OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_NETWORK_NETWORK_DEVICE_HANDLER_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_DEVICE_HANDLER_H_ |
6 #define CHROMEOS_NETWORK_NETWORK_DEVICE_HANDLER_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_DEVICE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // | 26 // |
27 // Note on callbacks: Because all the functions here are meant to be | 27 // Note on callbacks: Because all the functions here are meant to be |
28 // asynchronous, they take a |callback| of some type, and an |error_callback|. | 28 // asynchronous, they take a |callback| of some type, and an |error_callback|. |
29 // When the operation succeeds, |callback| will be called, and when it doesn't, | 29 // When the operation succeeds, |callback| will be called, and when it doesn't, |
30 // |error_callback| will be called with information about the error, including a | 30 // |error_callback| will be called with information about the error, including a |
31 // symbolic name for the error and often some error message that is suitable for | 31 // symbolic name for the error and often some error message that is suitable for |
32 // logging. None of the error message text is meant for user consumption. | 32 // logging. None of the error message text is meant for user consumption. |
33 class CHROMEOS_EXPORT NetworkDeviceHandler { | 33 class CHROMEOS_EXPORT NetworkDeviceHandler { |
34 public: | 34 public: |
35 // Constants for |error_name| from |error_callback|. | 35 // Constants for |error_name| from |error_callback|. |
| 36 static const char kErrorDeviceMissing[]; |
36 static const char kErrorFailure[]; | 37 static const char kErrorFailure[]; |
37 static const char kErrorIncorrectPin[]; | 38 static const char kErrorIncorrectPin[]; |
38 static const char kErrorNotFound[]; | 39 static const char kErrorNotFound[]; |
39 static const char kErrorNotSupported[]; | 40 static const char kErrorNotSupported[]; |
40 static const char kErrorPinBlocked[]; | 41 static const char kErrorPinBlocked[]; |
41 static const char kErrorPinRequired[]; | 42 static const char kErrorPinRequired[]; |
| 43 static const char kErrorTimeout[]; |
42 static const char kErrorUnknown[]; | 44 static const char kErrorUnknown[]; |
43 | 45 |
44 NetworkDeviceHandler(); | 46 NetworkDeviceHandler(); |
45 virtual ~NetworkDeviceHandler(); | 47 virtual ~NetworkDeviceHandler(); |
46 | 48 |
47 // Gets the properties of the device with id |device_path|. See note on | 49 // Gets the properties of the device with id |device_path|. See note on |
48 // |callback| and |error_callback|, in class description above. | 50 // |callback| and |error_callback|, in class description above. |
49 virtual void GetDeviceProperties( | 51 virtual void GetDeviceProperties( |
50 const std::string& device_path, | 52 const std::string& device_path, |
51 const network_handler::DictionaryResultCallback& callback, | 53 const network_handler::DictionaryResultCallback& callback, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 const std::string& old_pin, | 187 const std::string& old_pin, |
186 const std::string& new_pin, | 188 const std::string& new_pin, |
187 const base::Closure& callback, | 189 const base::Closure& callback, |
188 const network_handler::ErrorCallback& error_callback) = 0; | 190 const network_handler::ErrorCallback& error_callback) = 0; |
189 | 191 |
190 // Enables/disables roaming of all cellular devices. This happens | 192 // Enables/disables roaming of all cellular devices. This happens |
191 // asychronously in the background and applies also to devices which become | 193 // asychronously in the background and applies also to devices which become |
192 // available in the future. | 194 // available in the future. |
193 virtual void SetCellularAllowRoaming(bool allow_roaming) = 0; | 195 virtual void SetCellularAllowRoaming(bool allow_roaming) = 0; |
194 | 196 |
| 197 // Attempts to enable or disable TDLS for the specified IP or MAC address for |
| 198 // the active wifi device. |
| 199 virtual void SetWifiTDLSEnabled( |
| 200 const std::string& ip_or_mac_address, |
| 201 bool enabled, |
| 202 const network_handler::StringResultCallback& callback, |
| 203 const network_handler::ErrorCallback& error_callback) = 0; |
| 204 |
| 205 // Returns the TDLS status for the specified IP or MAC address for |
| 206 // the active wifi device. |
| 207 virtual void GetWifiTDLSStatus( |
| 208 const std::string& ip_or_mac_address, |
| 209 const network_handler::StringResultCallback& callback, |
| 210 const network_handler::ErrorCallback& error_callback) = 0; |
| 211 |
195 private: | 212 private: |
196 DISALLOW_COPY_AND_ASSIGN(NetworkDeviceHandler); | 213 DISALLOW_COPY_AND_ASSIGN(NetworkDeviceHandler); |
197 }; | 214 }; |
198 | 215 |
199 } // namespace chromeos | 216 } // namespace chromeos |
200 | 217 |
201 #endif // CHROMEOS_NETWORK_NETWORK_DEVICE_HANDLER_H_ | 218 #endif // CHROMEOS_NETWORK_NETWORK_DEVICE_HANDLER_H_ |
OLD | NEW |