| 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 // These classes implement the chrome.networkingPrivate JavaScript extension | 5 // These classes implement the chrome.networkingPrivate JavaScript extension |
| 6 // API. | 6 // API. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_
H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_
H_ |
| 9 #define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_
H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_
H_ |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 : public ChromeAsyncExtensionFunction { | 21 : public ChromeAsyncExtensionFunction { |
| 22 public: | 22 public: |
| 23 NetworkingPrivateGetPropertiesFunction() {} | 23 NetworkingPrivateGetPropertiesFunction() {} |
| 24 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties", | 24 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties", |
| 25 NETWORKINGPRIVATE_GETPROPERTIES); | 25 NETWORKINGPRIVATE_GETPROPERTIES); |
| 26 | 26 |
| 27 protected: | 27 protected: |
| 28 virtual ~NetworkingPrivateGetPropertiesFunction(); | 28 virtual ~NetworkingPrivateGetPropertiesFunction(); |
| 29 | 29 |
| 30 // AsyncExtensionFunction overrides. | 30 // AsyncExtensionFunction overrides. |
| 31 virtual bool RunImpl() OVERRIDE; | 31 virtual bool RunAsync() OVERRIDE; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 void GetPropertiesSuccess(const std::string& service_path, | 34 void GetPropertiesSuccess(const std::string& service_path, |
| 35 const base::DictionaryValue& result); | 35 const base::DictionaryValue& result); |
| 36 void GetPropertiesFailed(const std::string& error_name, | 36 void GetPropertiesFailed(const std::string& error_name, |
| 37 scoped_ptr<base::DictionaryValue> error_data); | 37 scoped_ptr<base::DictionaryValue> error_data); |
| 38 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); | 38 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 // Implements the chrome.networkingPrivate.getManagedProperties method. | 41 // Implements the chrome.networkingPrivate.getManagedProperties method. |
| 42 class NetworkingPrivateGetManagedPropertiesFunction | 42 class NetworkingPrivateGetManagedPropertiesFunction |
| 43 : public ChromeAsyncExtensionFunction { | 43 : public ChromeAsyncExtensionFunction { |
| 44 public: | 44 public: |
| 45 NetworkingPrivateGetManagedPropertiesFunction() {} | 45 NetworkingPrivateGetManagedPropertiesFunction() {} |
| 46 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getManagedProperties", | 46 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getManagedProperties", |
| 47 NETWORKINGPRIVATE_GETMANAGEDPROPERTIES); | 47 NETWORKINGPRIVATE_GETMANAGEDPROPERTIES); |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 virtual ~NetworkingPrivateGetManagedPropertiesFunction(); | 50 virtual ~NetworkingPrivateGetManagedPropertiesFunction(); |
| 51 | 51 |
| 52 // AsyncExtensionFunction overrides. | 52 // AsyncExtensionFunction overrides. |
| 53 virtual bool RunImpl() OVERRIDE; | 53 virtual bool RunAsync() OVERRIDE; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 // Callbacks for ManagedNetworkConfigurationHandler::GetManagedProperties. | 56 // Callbacks for ManagedNetworkConfigurationHandler::GetManagedProperties. |
| 57 void Success(const std::string& service_path, | 57 void Success(const std::string& service_path, |
| 58 const base::DictionaryValue& result); | 58 const base::DictionaryValue& result); |
| 59 void Failure(const std::string& error_name, | 59 void Failure(const std::string& error_name, |
| 60 scoped_ptr<base::DictionaryValue> error_data); | 60 scoped_ptr<base::DictionaryValue> error_data); |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetManagedPropertiesFunction); | 62 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetManagedPropertiesFunction); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 // Implements the chrome.networkingPrivate.getState method. | 65 // Implements the chrome.networkingPrivate.getState method. |
| 66 class NetworkingPrivateGetStateFunction : public ChromeAsyncExtensionFunction { | 66 class NetworkingPrivateGetStateFunction : public ChromeAsyncExtensionFunction { |
| 67 public: | 67 public: |
| 68 NetworkingPrivateGetStateFunction() {} | 68 NetworkingPrivateGetStateFunction() {} |
| 69 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState", | 69 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState", |
| 70 NETWORKINGPRIVATE_GETSTATE); | 70 NETWORKINGPRIVATE_GETSTATE); |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 virtual ~NetworkingPrivateGetStateFunction(); | 73 virtual ~NetworkingPrivateGetStateFunction(); |
| 74 | 74 |
| 75 // AsyncExtensionFunction overrides. | 75 // AsyncExtensionFunction overrides. |
| 76 virtual bool RunImpl() OVERRIDE; | 76 virtual bool RunAsync() OVERRIDE; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 void Success(const std::string& service_path, | 79 void Success(const std::string& service_path, |
| 80 const base::DictionaryValue& result); | 80 const base::DictionaryValue& result); |
| 81 void Failure(const std::string& error_name, | 81 void Failure(const std::string& error_name, |
| 82 scoped_ptr<base::DictionaryValue> error_data); | 82 scoped_ptr<base::DictionaryValue> error_data); |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetStateFunction); | 84 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetStateFunction); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 // Implements the chrome.networkingPrivate.setProperties method. | 87 // Implements the chrome.networkingPrivate.setProperties method. |
| 88 class NetworkingPrivateSetPropertiesFunction | 88 class NetworkingPrivateSetPropertiesFunction |
| 89 : public ChromeAsyncExtensionFunction { | 89 : public ChromeAsyncExtensionFunction { |
| 90 public: | 90 public: |
| 91 NetworkingPrivateSetPropertiesFunction() {} | 91 NetworkingPrivateSetPropertiesFunction() {} |
| 92 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setProperties", | 92 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setProperties", |
| 93 NETWORKINGPRIVATE_SETPROPERTIES); | 93 NETWORKINGPRIVATE_SETPROPERTIES); |
| 94 | 94 |
| 95 protected: | 95 protected: |
| 96 virtual ~NetworkingPrivateSetPropertiesFunction(); | 96 virtual ~NetworkingPrivateSetPropertiesFunction(); |
| 97 | 97 |
| 98 // AsyncExtensionFunction overrides. | 98 // AsyncExtensionFunction overrides. |
| 99 virtual bool RunImpl() OVERRIDE; | 99 virtual bool RunAsync() OVERRIDE; |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 void ErrorCallback(const std::string& error_name, | 102 void ErrorCallback(const std::string& error_name, |
| 103 const scoped_ptr<base::DictionaryValue> error_data); | 103 const scoped_ptr<base::DictionaryValue> error_data); |
| 104 void ResultCallback(); | 104 void ResultCallback(); |
| 105 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetPropertiesFunction); | 105 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetPropertiesFunction); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 // Implements the chrome.networkingPrivate.createNetwork method. | 108 // Implements the chrome.networkingPrivate.createNetwork method. |
| 109 class NetworkingPrivateCreateNetworkFunction | 109 class NetworkingPrivateCreateNetworkFunction |
| 110 : public ChromeAsyncExtensionFunction { | 110 : public ChromeAsyncExtensionFunction { |
| 111 public: | 111 public: |
| 112 NetworkingPrivateCreateNetworkFunction() {} | 112 NetworkingPrivateCreateNetworkFunction() {} |
| 113 DECLARE_EXTENSION_FUNCTION("networkingPrivate.createNetwork", | 113 DECLARE_EXTENSION_FUNCTION("networkingPrivate.createNetwork", |
| 114 NETWORKINGPRIVATE_CREATENETWORK); | 114 NETWORKINGPRIVATE_CREATENETWORK); |
| 115 | 115 |
| 116 protected: | 116 protected: |
| 117 virtual ~NetworkingPrivateCreateNetworkFunction(); | 117 virtual ~NetworkingPrivateCreateNetworkFunction(); |
| 118 | 118 |
| 119 // AsyncExtensionFunction overrides. | 119 // AsyncExtensionFunction overrides. |
| 120 virtual bool RunImpl() OVERRIDE; | 120 virtual bool RunAsync() OVERRIDE; |
| 121 | 121 |
| 122 private: | 122 private: |
| 123 void ErrorCallback(const std::string& error_name, | 123 void ErrorCallback(const std::string& error_name, |
| 124 const scoped_ptr<base::DictionaryValue> error_data); | 124 const scoped_ptr<base::DictionaryValue> error_data); |
| 125 void ResultCallback(const std::string& guid); | 125 void ResultCallback(const std::string& guid); |
| 126 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateCreateNetworkFunction); | 126 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateCreateNetworkFunction); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 // Implements the chrome.networkingPrivate.getVisibleNetworks method. | 129 // Implements the chrome.networkingPrivate.getVisibleNetworks method. |
| 130 class NetworkingPrivateGetVisibleNetworksFunction | 130 class NetworkingPrivateGetVisibleNetworksFunction |
| 131 : public ChromeAsyncExtensionFunction { | 131 : public ChromeAsyncExtensionFunction { |
| 132 public: | 132 public: |
| 133 NetworkingPrivateGetVisibleNetworksFunction() {} | 133 NetworkingPrivateGetVisibleNetworksFunction() {} |
| 134 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks", | 134 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks", |
| 135 NETWORKINGPRIVATE_GETVISIBLENETWORKS); | 135 NETWORKINGPRIVATE_GETVISIBLENETWORKS); |
| 136 | 136 |
| 137 protected: | 137 protected: |
| 138 virtual ~NetworkingPrivateGetVisibleNetworksFunction(); | 138 virtual ~NetworkingPrivateGetVisibleNetworksFunction(); |
| 139 | 139 |
| 140 // AsyncExtensionFunction overrides. | 140 // AsyncExtensionFunction overrides. |
| 141 virtual bool RunImpl() OVERRIDE; | 141 virtual bool RunAsync() OVERRIDE; |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 void ResultCallback(const base::ListValue& network_list); | 144 void ResultCallback(const base::ListValue& network_list); |
| 145 | 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction); | 146 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method. | 149 // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method. |
| 150 class NetworkingPrivateGetEnabledNetworkTypesFunction | 150 class NetworkingPrivateGetEnabledNetworkTypesFunction |
| 151 : public ChromeSyncExtensionFunction { | 151 : public ChromeSyncExtensionFunction { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 : public ChromeAsyncExtensionFunction { | 224 : public ChromeAsyncExtensionFunction { |
| 225 public: | 225 public: |
| 226 NetworkingPrivateStartConnectFunction() {} | 226 NetworkingPrivateStartConnectFunction() {} |
| 227 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startConnect", | 227 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startConnect", |
| 228 NETWORKINGPRIVATE_STARTCONNECT); | 228 NETWORKINGPRIVATE_STARTCONNECT); |
| 229 | 229 |
| 230 protected: | 230 protected: |
| 231 virtual ~NetworkingPrivateStartConnectFunction(); | 231 virtual ~NetworkingPrivateStartConnectFunction(); |
| 232 | 232 |
| 233 // AsyncExtensionFunction overrides. | 233 // AsyncExtensionFunction overrides. |
| 234 virtual bool RunImpl() OVERRIDE; | 234 virtual bool RunAsync() OVERRIDE; |
| 235 | 235 |
| 236 private: | 236 private: |
| 237 // Called when the request to connect succeeds. Doesn't mean that the connect | 237 // Called when the request to connect succeeds. Doesn't mean that the connect |
| 238 // itself succeeded, just that the request did. | 238 // itself succeeded, just that the request did. |
| 239 void ConnectionStartSuccess(); | 239 void ConnectionStartSuccess(); |
| 240 | 240 |
| 241 void ConnectionStartFailed( | 241 void ConnectionStartFailed( |
| 242 const std::string& error_name, | 242 const std::string& error_name, |
| 243 const scoped_ptr<base::DictionaryValue> error_data); | 243 const scoped_ptr<base::DictionaryValue> error_data); |
| 244 | 244 |
| 245 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartConnectFunction); | 245 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartConnectFunction); |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 // Implements the chrome.networkingPrivate.startDisconnect method. | 248 // Implements the chrome.networkingPrivate.startDisconnect method. |
| 249 class NetworkingPrivateStartDisconnectFunction | 249 class NetworkingPrivateStartDisconnectFunction |
| 250 : public ChromeAsyncExtensionFunction { | 250 : public ChromeAsyncExtensionFunction { |
| 251 public: | 251 public: |
| 252 NetworkingPrivateStartDisconnectFunction() {} | 252 NetworkingPrivateStartDisconnectFunction() {} |
| 253 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startDisconnect", | 253 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startDisconnect", |
| 254 NETWORKINGPRIVATE_STARTDISCONNECT); | 254 NETWORKINGPRIVATE_STARTDISCONNECT); |
| 255 | 255 |
| 256 protected: | 256 protected: |
| 257 virtual ~NetworkingPrivateStartDisconnectFunction(); | 257 virtual ~NetworkingPrivateStartDisconnectFunction(); |
| 258 | 258 |
| 259 // AsyncExtensionFunction overrides. | 259 // AsyncExtensionFunction overrides. |
| 260 virtual bool RunImpl() OVERRIDE; | 260 virtual bool RunAsync() OVERRIDE; |
| 261 | 261 |
| 262 private: | 262 private: |
| 263 // Called when the request to disconnect succeeds. Doesn't mean that the | 263 // Called when the request to disconnect succeeds. Doesn't mean that the |
| 264 // disconnect itself succeeded, just that the request did. | 264 // disconnect itself succeeded, just that the request did. |
| 265 void DisconnectionStartSuccess(); | 265 void DisconnectionStartSuccess(); |
| 266 | 266 |
| 267 void DisconnectionStartFailed( | 267 void DisconnectionStartFailed( |
| 268 const std::string& error_name, | 268 const std::string& error_name, |
| 269 const scoped_ptr<base::DictionaryValue> error_data); | 269 const scoped_ptr<base::DictionaryValue> error_data); |
| 270 | 270 |
| 271 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartDisconnectFunction); | 271 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartDisconnectFunction); |
| 272 }; | 272 }; |
| 273 | 273 |
| 274 // Implements the chrome.networkingPrivate.verifyDestination method. | 274 // Implements the chrome.networkingPrivate.verifyDestination method. |
| 275 class NetworkingPrivateVerifyDestinationFunction | 275 class NetworkingPrivateVerifyDestinationFunction |
| 276 : public ChromeAsyncExtensionFunction { | 276 : public ChromeAsyncExtensionFunction { |
| 277 public: | 277 public: |
| 278 NetworkingPrivateVerifyDestinationFunction() {} | 278 NetworkingPrivateVerifyDestinationFunction() {} |
| 279 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyDestination", | 279 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyDestination", |
| 280 NETWORKINGPRIVATE_VERIFYDESTINATION); | 280 NETWORKINGPRIVATE_VERIFYDESTINATION); |
| 281 | 281 |
| 282 protected: | 282 protected: |
| 283 virtual ~NetworkingPrivateVerifyDestinationFunction(); | 283 virtual ~NetworkingPrivateVerifyDestinationFunction(); |
| 284 | 284 |
| 285 // AsyncExtensionFunction overrides. | 285 // AsyncExtensionFunction overrides. |
| 286 virtual bool RunImpl() OVERRIDE; | 286 virtual bool RunAsync() OVERRIDE; |
| 287 | 287 |
| 288 void ResultCallback(bool result); | 288 void ResultCallback(bool result); |
| 289 void ErrorCallback(const std::string& error_name, const std::string& error); | 289 void ErrorCallback(const std::string& error_name, const std::string& error); |
| 290 | 290 |
| 291 private: | 291 private: |
| 292 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyDestinationFunction); | 292 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyDestinationFunction); |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 // Implements the chrome.networkingPrivate.verifyAndEncryptCredentials method. | 295 // Implements the chrome.networkingPrivate.verifyAndEncryptCredentials method. |
| 296 class NetworkingPrivateVerifyAndEncryptCredentialsFunction | 296 class NetworkingPrivateVerifyAndEncryptCredentialsFunction |
| 297 : public ChromeAsyncExtensionFunction { | 297 : public ChromeAsyncExtensionFunction { |
| 298 public: | 298 public: |
| 299 NetworkingPrivateVerifyAndEncryptCredentialsFunction() {} | 299 NetworkingPrivateVerifyAndEncryptCredentialsFunction() {} |
| 300 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyAndEncryptCredentials", | 300 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyAndEncryptCredentials", |
| 301 NETWORKINGPRIVATE_VERIFYANDENCRYPTCREDENTIALS); | 301 NETWORKINGPRIVATE_VERIFYANDENCRYPTCREDENTIALS); |
| 302 | 302 |
| 303 protected: | 303 protected: |
| 304 virtual ~NetworkingPrivateVerifyAndEncryptCredentialsFunction(); | 304 virtual ~NetworkingPrivateVerifyAndEncryptCredentialsFunction(); |
| 305 | 305 |
| 306 // AsyncExtensionFunction overrides. | 306 // AsyncExtensionFunction overrides. |
| 307 virtual bool RunImpl() OVERRIDE; | 307 virtual bool RunAsync() OVERRIDE; |
| 308 | 308 |
| 309 void ResultCallback(const std::string& result); | 309 void ResultCallback(const std::string& result); |
| 310 void ErrorCallback(const std::string& error_name, const std::string& error); | 310 void ErrorCallback(const std::string& error_name, const std::string& error); |
| 311 | 311 |
| 312 private: | 312 private: |
| 313 DISALLOW_COPY_AND_ASSIGN( | 313 DISALLOW_COPY_AND_ASSIGN( |
| 314 NetworkingPrivateVerifyAndEncryptCredentialsFunction); | 314 NetworkingPrivateVerifyAndEncryptCredentialsFunction); |
| 315 }; | 315 }; |
| 316 | 316 |
| 317 // Implements the chrome.networkingPrivate.verifyAndEncryptData method. | 317 // Implements the chrome.networkingPrivate.verifyAndEncryptData method. |
| 318 class NetworkingPrivateVerifyAndEncryptDataFunction | 318 class NetworkingPrivateVerifyAndEncryptDataFunction |
| 319 : public ChromeAsyncExtensionFunction { | 319 : public ChromeAsyncExtensionFunction { |
| 320 public: | 320 public: |
| 321 NetworkingPrivateVerifyAndEncryptDataFunction() {} | 321 NetworkingPrivateVerifyAndEncryptDataFunction() {} |
| 322 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyAndEncryptData", | 322 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyAndEncryptData", |
| 323 NETWORKINGPRIVATE_VERIFYANDENCRYPTDATA); | 323 NETWORKINGPRIVATE_VERIFYANDENCRYPTDATA); |
| 324 | 324 |
| 325 protected: | 325 protected: |
| 326 virtual ~NetworkingPrivateVerifyAndEncryptDataFunction(); | 326 virtual ~NetworkingPrivateVerifyAndEncryptDataFunction(); |
| 327 | 327 |
| 328 // AsyncExtensionFunction overrides. | 328 // AsyncExtensionFunction overrides. |
| 329 virtual bool RunImpl() OVERRIDE; | 329 virtual bool RunAsync() OVERRIDE; |
| 330 | 330 |
| 331 void ResultCallback(const std::string& result); | 331 void ResultCallback(const std::string& result); |
| 332 void ErrorCallback(const std::string& error_name, const std::string& error); | 332 void ErrorCallback(const std::string& error_name, const std::string& error); |
| 333 | 333 |
| 334 private: | 334 private: |
| 335 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyAndEncryptDataFunction); | 335 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyAndEncryptDataFunction); |
| 336 }; | 336 }; |
| 337 | 337 |
| 338 // Implements the chrome.networkingPrivate.setWifiTDLSEnabledState method. | 338 // Implements the chrome.networkingPrivate.setWifiTDLSEnabledState method. |
| 339 class NetworkingPrivateSetWifiTDLSEnabledStateFunction | 339 class NetworkingPrivateSetWifiTDLSEnabledStateFunction |
| 340 : public ChromeAsyncExtensionFunction { | 340 : public ChromeAsyncExtensionFunction { |
| 341 public: | 341 public: |
| 342 NetworkingPrivateSetWifiTDLSEnabledStateFunction() {} | 342 NetworkingPrivateSetWifiTDLSEnabledStateFunction() {} |
| 343 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setWifiTDLSEnabledState", | 343 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setWifiTDLSEnabledState", |
| 344 NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE); | 344 NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE); |
| 345 | 345 |
| 346 protected: | 346 protected: |
| 347 virtual ~NetworkingPrivateSetWifiTDLSEnabledStateFunction(); | 347 virtual ~NetworkingPrivateSetWifiTDLSEnabledStateFunction(); |
| 348 | 348 |
| 349 // AsyncExtensionFunction overrides. | 349 // AsyncExtensionFunction overrides. |
| 350 virtual bool RunImpl() OVERRIDE; | 350 virtual bool RunAsync() OVERRIDE; |
| 351 | 351 |
| 352 void Success(const std::string& result); | 352 void Success(const std::string& result); |
| 353 void Failure(const std::string& error_name, | 353 void Failure(const std::string& error_name, |
| 354 scoped_ptr<base::DictionaryValue> error_data); | 354 scoped_ptr<base::DictionaryValue> error_data); |
| 355 | 355 |
| 356 private: | 356 private: |
| 357 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetWifiTDLSEnabledStateFunction); | 357 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetWifiTDLSEnabledStateFunction); |
| 358 }; | 358 }; |
| 359 | 359 |
| 360 // Implements the chrome.networkingPrivate.getWifiTDLSStatus method. | 360 // Implements the chrome.networkingPrivate.getWifiTDLSStatus method. |
| 361 class NetworkingPrivateGetWifiTDLSStatusFunction | 361 class NetworkingPrivateGetWifiTDLSStatusFunction |
| 362 : public ChromeAsyncExtensionFunction { | 362 : public ChromeAsyncExtensionFunction { |
| 363 public: | 363 public: |
| 364 NetworkingPrivateGetWifiTDLSStatusFunction() {} | 364 NetworkingPrivateGetWifiTDLSStatusFunction() {} |
| 365 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getWifiTDLSStatus", | 365 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getWifiTDLSStatus", |
| 366 NETWORKINGPRIVATE_GETWIFITDLSSTATUS); | 366 NETWORKINGPRIVATE_GETWIFITDLSSTATUS); |
| 367 | 367 |
| 368 protected: | 368 protected: |
| 369 virtual ~NetworkingPrivateGetWifiTDLSStatusFunction(); | 369 virtual ~NetworkingPrivateGetWifiTDLSStatusFunction(); |
| 370 | 370 |
| 371 // AsyncExtensionFunction overrides. | 371 // AsyncExtensionFunction overrides. |
| 372 virtual bool RunImpl() OVERRIDE; | 372 virtual bool RunAsync() OVERRIDE; |
| 373 | 373 |
| 374 void Success(const std::string& result); | 374 void Success(const std::string& result); |
| 375 void Failure(const std::string& error_name, | 375 void Failure(const std::string& error_name, |
| 376 scoped_ptr<base::DictionaryValue> error_data); | 376 scoped_ptr<base::DictionaryValue> error_data); |
| 377 | 377 |
| 378 private: | 378 private: |
| 379 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetWifiTDLSStatusFunction); | 379 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetWifiTDLSStatusFunction); |
| 380 }; | 380 }; |
| 381 | 381 |
| 382 class NetworkingPrivateGetCaptivePortalStatusFunction | 382 class NetworkingPrivateGetCaptivePortalStatusFunction |
| 383 : public ChromeAsyncExtensionFunction { | 383 : public ChromeAsyncExtensionFunction { |
| 384 public: | 384 public: |
| 385 NetworkingPrivateGetCaptivePortalStatusFunction() {} | 385 NetworkingPrivateGetCaptivePortalStatusFunction() {} |
| 386 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getCaptivePortalStatus", | 386 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getCaptivePortalStatus", |
| 387 NETWORKINGPRIVATE_GETCAPTIVEPORTALSTATUS); | 387 NETWORKINGPRIVATE_GETCAPTIVEPORTALSTATUS); |
| 388 | 388 |
| 389 // AsyncExtensionFunction overrides. | 389 // AsyncExtensionFunction overrides. |
| 390 virtual bool RunImpl() OVERRIDE; | 390 virtual bool RunAsync() OVERRIDE; |
| 391 | 391 |
| 392 protected: | 392 protected: |
| 393 virtual ~NetworkingPrivateGetCaptivePortalStatusFunction(); | 393 virtual ~NetworkingPrivateGetCaptivePortalStatusFunction(); |
| 394 | 394 |
| 395 private: | 395 private: |
| 396 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetCaptivePortalStatusFunction); | 396 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetCaptivePortalStatusFunction); |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 #endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_A
PI_H_ | 399 #endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_A
PI_H_ |
| OLD | NEW |