Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: extensions/browser/api/networking_private/networking_private_api.h

Issue 2612873004: Remove some usages of AsyncExtensionFunction::results_. (Closed)
Patch Set: sync Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_
6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ 6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "extensions/browser/extension_function.h" 13 #include "extensions/browser/extension_function.h"
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 namespace networking_private { 17 namespace networking_private {
18 18
19 extern const char kErrorInvalidNetworkGuid[]; 19 extern const char kErrorInvalidNetworkGuid[];
20 extern const char kErrorInvalidNetworkOperation[]; 20 extern const char kErrorInvalidNetworkOperation[];
21 extern const char kErrorNetworkUnavailable[]; 21 extern const char kErrorNetworkUnavailable[];
22 extern const char kErrorEncryptionError[]; 22 extern const char kErrorEncryptionError[];
23 extern const char kErrorNotReady[]; 23 extern const char kErrorNotReady[];
24 extern const char kErrorNotSupported[]; 24 extern const char kErrorNotSupported[];
25 extern const char kErrorSimLocked[]; 25 extern const char kErrorSimLocked[];
26 26
27 } // namespace networking_private 27 } // namespace networking_private
28 28
29 // Implements the chrome.networkingPrivate.getProperties method. 29 // Implements the chrome.networkingPrivate.getProperties method.
30 class NetworkingPrivateGetPropertiesFunction : public AsyncExtensionFunction { 30 class NetworkingPrivateGetPropertiesFunction
31 : public UIThreadExtensionFunction {
31 public: 32 public:
32 NetworkingPrivateGetPropertiesFunction() {} 33 NetworkingPrivateGetPropertiesFunction() {}
33 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties", 34 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties",
34 NETWORKINGPRIVATE_GETPROPERTIES); 35 NETWORKINGPRIVATE_GETPROPERTIES);
35 36
36 protected: 37 protected:
37 ~NetworkingPrivateGetPropertiesFunction() override; 38 ~NetworkingPrivateGetPropertiesFunction() override;
38 39
39 // AsyncExtensionFunction overrides. 40 // ExtensionFunction:
40 bool RunAsync() override; 41 ResponseAction Run() override;
41 42
42 private: 43 private:
43 void Success(std::unique_ptr<base::DictionaryValue> result); 44 void Success(std::unique_ptr<base::DictionaryValue> result);
44 void Failure(const std::string& error_name); 45 void Failure(const std::string& error_name);
45 46
46 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); 47 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction);
47 }; 48 };
48 49
49 // Implements the chrome.networkingPrivate.getManagedProperties method. 50 // Implements the chrome.networkingPrivate.getManagedProperties method.
50 class NetworkingPrivateGetManagedPropertiesFunction 51 class NetworkingPrivateGetManagedPropertiesFunction
51 : public AsyncExtensionFunction { 52 : public UIThreadExtensionFunction {
52 public: 53 public:
53 NetworkingPrivateGetManagedPropertiesFunction() {} 54 NetworkingPrivateGetManagedPropertiesFunction() {}
54 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getManagedProperties", 55 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getManagedProperties",
55 NETWORKINGPRIVATE_GETMANAGEDPROPERTIES); 56 NETWORKINGPRIVATE_GETMANAGEDPROPERTIES);
56 57
57 protected: 58 protected:
58 ~NetworkingPrivateGetManagedPropertiesFunction() override; 59 ~NetworkingPrivateGetManagedPropertiesFunction() override;
59 60
60 // AsyncExtensionFunction overrides. 61 // ExtensionFunction:
61 bool RunAsync() override; 62 ResponseAction Run() override;
62 63
63 private: 64 private:
64 void Success(std::unique_ptr<base::DictionaryValue> result); 65 void Success(std::unique_ptr<base::DictionaryValue> result);
65 void Failure(const std::string& error); 66 void Failure(const std::string& error);
66 67
67 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetManagedPropertiesFunction); 68 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetManagedPropertiesFunction);
68 }; 69 };
69 70
70 // Implements the chrome.networkingPrivate.getState method. 71 // Implements the chrome.networkingPrivate.getState method.
71 class NetworkingPrivateGetStateFunction : public AsyncExtensionFunction { 72 class NetworkingPrivateGetStateFunction : public UIThreadExtensionFunction {
72 public: 73 public:
73 NetworkingPrivateGetStateFunction() {} 74 NetworkingPrivateGetStateFunction() {}
74 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState", 75 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState",
75 NETWORKINGPRIVATE_GETSTATE); 76 NETWORKINGPRIVATE_GETSTATE);
76 77
77 protected: 78 protected:
78 ~NetworkingPrivateGetStateFunction() override; 79 ~NetworkingPrivateGetStateFunction() override;
79 80
80 // AsyncExtensionFunction overrides. 81 // ExtensionFunction:
81 bool RunAsync() override; 82 ResponseAction Run() override;
82 83
83 private: 84 private:
84 void Success(std::unique_ptr<base::DictionaryValue> result); 85 void Success(std::unique_ptr<base::DictionaryValue> result);
85 void Failure(const std::string& error); 86 void Failure(const std::string& error);
86 87
87 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetStateFunction); 88 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetStateFunction);
88 }; 89 };
89 90
90 // Implements the chrome.networkingPrivate.setProperties method. 91 // Implements the chrome.networkingPrivate.setProperties method.
91 class NetworkingPrivateSetPropertiesFunction : public AsyncExtensionFunction { 92 class NetworkingPrivateSetPropertiesFunction
93 : public UIThreadExtensionFunction {
92 public: 94 public:
93 NetworkingPrivateSetPropertiesFunction() {} 95 NetworkingPrivateSetPropertiesFunction() {}
94 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setProperties", 96 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setProperties",
95 NETWORKINGPRIVATE_SETPROPERTIES); 97 NETWORKINGPRIVATE_SETPROPERTIES);
96 98
97 protected: 99 protected:
98 ~NetworkingPrivateSetPropertiesFunction() override; 100 ~NetworkingPrivateSetPropertiesFunction() override;
99 101
100 // AsyncExtensionFunction overrides. 102 // ExtensionFunction:
101 bool RunAsync() override; 103 ResponseAction Run() override;
102 104
103 private: 105 private:
104 void Success(); 106 void Success();
105 void Failure(const std::string& error); 107 void Failure(const std::string& error);
106 108
107 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetPropertiesFunction); 109 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetPropertiesFunction);
108 }; 110 };
109 111
110 // Implements the chrome.networkingPrivate.createNetwork method. 112 // Implements the chrome.networkingPrivate.createNetwork method.
111 class NetworkingPrivateCreateNetworkFunction : public AsyncExtensionFunction { 113 class NetworkingPrivateCreateNetworkFunction
114 : public UIThreadExtensionFunction {
112 public: 115 public:
113 NetworkingPrivateCreateNetworkFunction() {} 116 NetworkingPrivateCreateNetworkFunction() {}
114 DECLARE_EXTENSION_FUNCTION("networkingPrivate.createNetwork", 117 DECLARE_EXTENSION_FUNCTION("networkingPrivate.createNetwork",
115 NETWORKINGPRIVATE_CREATENETWORK); 118 NETWORKINGPRIVATE_CREATENETWORK);
116 119
117 protected: 120 protected:
118 ~NetworkingPrivateCreateNetworkFunction() override; 121 ~NetworkingPrivateCreateNetworkFunction() override;
119 122
120 // AsyncExtensionFunction overrides. 123 // ExtensionFunction:
121 bool RunAsync() override; 124 ResponseAction Run() override;
122 125
123 private: 126 private:
124 void Success(const std::string& guid); 127 void Success(const std::string& guid);
125 void Failure(const std::string& error); 128 void Failure(const std::string& error);
126 129
127 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateCreateNetworkFunction); 130 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateCreateNetworkFunction);
128 }; 131 };
129 132
130 // Implements the chrome.networkingPrivate.createNetwork method. 133 // Implements the chrome.networkingPrivate.createNetwork method.
131 class NetworkingPrivateForgetNetworkFunction : public AsyncExtensionFunction { 134 class NetworkingPrivateForgetNetworkFunction
135 : public UIThreadExtensionFunction {
132 public: 136 public:
133 NetworkingPrivateForgetNetworkFunction() {} 137 NetworkingPrivateForgetNetworkFunction() {}
134 DECLARE_EXTENSION_FUNCTION("networkingPrivate.forgetNetwork", 138 DECLARE_EXTENSION_FUNCTION("networkingPrivate.forgetNetwork",
135 NETWORKINGPRIVATE_FORGETNETWORK); 139 NETWORKINGPRIVATE_FORGETNETWORK);
136 140
137 protected: 141 protected:
138 ~NetworkingPrivateForgetNetworkFunction() override; 142 ~NetworkingPrivateForgetNetworkFunction() override;
139 143
140 // AsyncExtensionFunction overrides. 144 // ExtensionFunction:
141 bool RunAsync() override; 145 ResponseAction Run() override;
142 146
143 private: 147 private:
144 void Success(); 148 void Success();
145 void Failure(const std::string& error); 149 void Failure(const std::string& error);
146 150
147 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateForgetNetworkFunction); 151 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateForgetNetworkFunction);
148 }; 152 };
149 153
150 // Implements the chrome.networkingPrivate.getNetworks method. 154 // Implements the chrome.networkingPrivate.getNetworks method.
151 class NetworkingPrivateGetNetworksFunction : public AsyncExtensionFunction { 155 class NetworkingPrivateGetNetworksFunction : public UIThreadExtensionFunction {
152 public: 156 public:
153 NetworkingPrivateGetNetworksFunction() {} 157 NetworkingPrivateGetNetworksFunction() {}
154 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getNetworks", 158 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getNetworks",
155 NETWORKINGPRIVATE_GETNETWORKS); 159 NETWORKINGPRIVATE_GETNETWORKS);
156 160
157 protected: 161 protected:
158 ~NetworkingPrivateGetNetworksFunction() override; 162 ~NetworkingPrivateGetNetworksFunction() override;
159 163
160 // AsyncExtensionFunction overrides. 164 // ExtensionFunction:
161 bool RunAsync() override; 165 ResponseAction Run() override;
162 166
163 private: 167 private:
164 void Success(std::unique_ptr<base::ListValue> network_list); 168 void Success(std::unique_ptr<base::ListValue> network_list);
165 void Failure(const std::string& error); 169 void Failure(const std::string& error);
166 170
167 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetNetworksFunction); 171 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetNetworksFunction);
168 }; 172 };
169 173
170 // Implements the chrome.networkingPrivate.getVisibleNetworks method. 174 // Implements the chrome.networkingPrivate.getVisibleNetworks method.
171 class NetworkingPrivateGetVisibleNetworksFunction 175 class NetworkingPrivateGetVisibleNetworksFunction
172 : public AsyncExtensionFunction { 176 : public UIThreadExtensionFunction {
173 public: 177 public:
174 NetworkingPrivateGetVisibleNetworksFunction() {} 178 NetworkingPrivateGetVisibleNetworksFunction() {}
175 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks", 179 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks",
176 NETWORKINGPRIVATE_GETVISIBLENETWORKS); 180 NETWORKINGPRIVATE_GETVISIBLENETWORKS);
177 181
178 protected: 182 protected:
179 ~NetworkingPrivateGetVisibleNetworksFunction() override; 183 ~NetworkingPrivateGetVisibleNetworksFunction() override;
180 184
181 // AsyncExtensionFunction overrides. 185 // ExtensionFunction:
182 bool RunAsync() override; 186 ResponseAction Run() override;
183 187
184 private: 188 private:
185 void Success(std::unique_ptr<base::ListValue> network_list); 189 void Success(std::unique_ptr<base::ListValue> network_list);
186 void Failure(const std::string& error); 190 void Failure(const std::string& error);
187 191
188 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction); 192 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction);
189 }; 193 };
190 194
191 // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method. 195 // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method.
192 class NetworkingPrivateGetEnabledNetworkTypesFunction 196 class NetworkingPrivateGetEnabledNetworkTypesFunction
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 ~NetworkingPrivateRequestNetworkScanFunction() override; 276 ~NetworkingPrivateRequestNetworkScanFunction() override;
273 277
274 // ExtensionFunction: 278 // ExtensionFunction:
275 ResponseAction Run() override; 279 ResponseAction Run() override;
276 280
277 private: 281 private:
278 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateRequestNetworkScanFunction); 282 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateRequestNetworkScanFunction);
279 }; 283 };
280 284
281 // Implements the chrome.networkingPrivate.startConnect method. 285 // Implements the chrome.networkingPrivate.startConnect method.
282 class NetworkingPrivateStartConnectFunction : public AsyncExtensionFunction { 286 class NetworkingPrivateStartConnectFunction : public UIThreadExtensionFunction {
283 public: 287 public:
284 NetworkingPrivateStartConnectFunction() {} 288 NetworkingPrivateStartConnectFunction() {}
285 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startConnect", 289 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startConnect",
286 NETWORKINGPRIVATE_STARTCONNECT); 290 NETWORKINGPRIVATE_STARTCONNECT);
287 291
288 protected: 292 protected:
289 ~NetworkingPrivateStartConnectFunction() override; 293 ~NetworkingPrivateStartConnectFunction() override;
290 294
291 // AsyncExtensionFunction overrides. 295 // ExtensionFunction:
292 bool RunAsync() override; 296 ResponseAction Run() override;
293 297
294 private: 298 private:
295 void Success(); 299 void Success();
296 void Failure(const std::string& error); 300 void Failure(const std::string& error);
297 301
298 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartConnectFunction); 302 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartConnectFunction);
299 }; 303 };
300 304
301 // Implements the chrome.networkingPrivate.startDisconnect method. 305 // Implements the chrome.networkingPrivate.startDisconnect method.
302 class NetworkingPrivateStartDisconnectFunction : public AsyncExtensionFunction { 306 class NetworkingPrivateStartDisconnectFunction
307 : public UIThreadExtensionFunction {
303 public: 308 public:
304 NetworkingPrivateStartDisconnectFunction() {} 309 NetworkingPrivateStartDisconnectFunction() {}
305 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startDisconnect", 310 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startDisconnect",
306 NETWORKINGPRIVATE_STARTDISCONNECT); 311 NETWORKINGPRIVATE_STARTDISCONNECT);
307 312
308 protected: 313 protected:
309 ~NetworkingPrivateStartDisconnectFunction() override; 314 ~NetworkingPrivateStartDisconnectFunction() override;
310 315
311 // AsyncExtensionFunction overrides. 316 // ExtensionFunction:
312 bool RunAsync() override; 317 ResponseAction Run() override;
313 318
314 private: 319 private:
315 void Success(); 320 void Success();
316 void Failure(const std::string& error); 321 void Failure(const std::string& error);
317 322
318 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartDisconnectFunction); 323 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartDisconnectFunction);
319 }; 324 };
320 325
321 // Implements the chrome.networkingPrivate.startActivate method. 326 // Implements the chrome.networkingPrivate.startActivate method.
322 class NetworkingPrivateStartActivateFunction : public AsyncExtensionFunction { 327 class NetworkingPrivateStartActivateFunction
328 : public UIThreadExtensionFunction {
323 public: 329 public:
324 NetworkingPrivateStartActivateFunction() {} 330 NetworkingPrivateStartActivateFunction() {}
325 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startActivate", 331 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startActivate",
326 NETWORKINGPRIVATE_STARTACTIVATE); 332 NETWORKINGPRIVATE_STARTACTIVATE);
327 333
328 protected: 334 protected:
329 ~NetworkingPrivateStartActivateFunction() override; 335 ~NetworkingPrivateStartActivateFunction() override;
330 336
331 // AsyncExtensionFunction overrides. 337 // ExtensionFunction:
332 bool RunAsync() override; 338 ResponseAction Run() override;
333 339
334 private: 340 private:
335 void Success(); 341 void Success();
336 void Failure(const std::string& error); 342 void Failure(const std::string& error);
337 343
338 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartActivateFunction); 344 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartActivateFunction);
339 }; 345 };
340 346
341 // Implements the chrome.networkingPrivate.verifyDestination method. 347 // Implements the chrome.networkingPrivate.verifyDestination method.
342 class NetworkingPrivateVerifyDestinationFunction 348 class NetworkingPrivateVerifyDestinationFunction
343 : public AsyncExtensionFunction { 349 : public UIThreadExtensionFunction {
344 public: 350 public:
345 NetworkingPrivateVerifyDestinationFunction() {} 351 NetworkingPrivateVerifyDestinationFunction() {}
346 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyDestination", 352 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyDestination",
347 NETWORKINGPRIVATE_VERIFYDESTINATION); 353 NETWORKINGPRIVATE_VERIFYDESTINATION);
348 354
349 protected: 355 protected:
350 ~NetworkingPrivateVerifyDestinationFunction() override; 356 ~NetworkingPrivateVerifyDestinationFunction() override;
351 357
352 // AsyncExtensionFunction overrides. 358 // ExtensionFunction:
353 bool RunAsync() override; 359 ResponseAction Run() override;
354 360
355 void Success(bool result); 361 void Success(bool result);
356 void Failure(const std::string& error); 362 void Failure(const std::string& error);
357 363
358 private: 364 private:
359 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyDestinationFunction); 365 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyDestinationFunction);
360 }; 366 };
361 367
362 // Implements the chrome.networkingPrivate.verifyAndEncryptCredentials method. 368 // Implements the chrome.networkingPrivate.verifyAndEncryptCredentials method.
363 class NetworkingPrivateVerifyAndEncryptCredentialsFunction 369 class NetworkingPrivateVerifyAndEncryptCredentialsFunction
364 : public AsyncExtensionFunction { 370 : public UIThreadExtensionFunction {
365 public: 371 public:
366 NetworkingPrivateVerifyAndEncryptCredentialsFunction() {} 372 NetworkingPrivateVerifyAndEncryptCredentialsFunction() {}
367 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyAndEncryptCredentials", 373 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyAndEncryptCredentials",
368 NETWORKINGPRIVATE_VERIFYANDENCRYPTCREDENTIALS); 374 NETWORKINGPRIVATE_VERIFYANDENCRYPTCREDENTIALS);
369 375
370 protected: 376 protected:
371 ~NetworkingPrivateVerifyAndEncryptCredentialsFunction() override; 377 ~NetworkingPrivateVerifyAndEncryptCredentialsFunction() override;
372 378
373 // AsyncExtensionFunction overrides. 379 // ExtensionFunction:
374 bool RunAsync() override; 380 ResponseAction Run() override;
375 381
376 void Success(const std::string& result); 382 void Success(const std::string& result);
377 void Failure(const std::string& error); 383 void Failure(const std::string& error);
378 384
379 private: 385 private:
380 DISALLOW_COPY_AND_ASSIGN( 386 DISALLOW_COPY_AND_ASSIGN(
381 NetworkingPrivateVerifyAndEncryptCredentialsFunction); 387 NetworkingPrivateVerifyAndEncryptCredentialsFunction);
382 }; 388 };
383 389
384 // Implements the chrome.networkingPrivate.verifyAndEncryptData method. 390 // Implements the chrome.networkingPrivate.verifyAndEncryptData method.
385 class NetworkingPrivateVerifyAndEncryptDataFunction 391 class NetworkingPrivateVerifyAndEncryptDataFunction
386 : public AsyncExtensionFunction { 392 : public UIThreadExtensionFunction {
387 public: 393 public:
388 NetworkingPrivateVerifyAndEncryptDataFunction() {} 394 NetworkingPrivateVerifyAndEncryptDataFunction() {}
389 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyAndEncryptData", 395 DECLARE_EXTENSION_FUNCTION("networkingPrivate.verifyAndEncryptData",
390 NETWORKINGPRIVATE_VERIFYANDENCRYPTDATA); 396 NETWORKINGPRIVATE_VERIFYANDENCRYPTDATA);
391 397
392 protected: 398 protected:
393 ~NetworkingPrivateVerifyAndEncryptDataFunction() override; 399 ~NetworkingPrivateVerifyAndEncryptDataFunction() override;
394 400
395 // AsyncExtensionFunction overrides. 401 // ExtensionFunction:
396 bool RunAsync() override; 402 ResponseAction Run() override;
397 403
398 void Success(const std::string& result); 404 void Success(const std::string& result);
399 void Failure(const std::string& error); 405 void Failure(const std::string& error);
400 406
401 private: 407 private:
402 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyAndEncryptDataFunction); 408 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyAndEncryptDataFunction);
403 }; 409 };
404 410
405 // Implements the chrome.networkingPrivate.setWifiTDLSEnabledState method. 411 // Implements the chrome.networkingPrivate.setWifiTDLSEnabledState method.
406 class NetworkingPrivateSetWifiTDLSEnabledStateFunction 412 class NetworkingPrivateSetWifiTDLSEnabledStateFunction
407 : public AsyncExtensionFunction { 413 : public UIThreadExtensionFunction {
408 public: 414 public:
409 NetworkingPrivateSetWifiTDLSEnabledStateFunction() {} 415 NetworkingPrivateSetWifiTDLSEnabledStateFunction() {}
410 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setWifiTDLSEnabledState", 416 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setWifiTDLSEnabledState",
411 NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE); 417 NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE);
412 418
413 protected: 419 protected:
414 ~NetworkingPrivateSetWifiTDLSEnabledStateFunction() override; 420 ~NetworkingPrivateSetWifiTDLSEnabledStateFunction() override;
415 421
416 // AsyncExtensionFunction overrides. 422 // ExtensionFunction:
417 bool RunAsync() override; 423 ResponseAction Run() override;
418 424
419 void Success(const std::string& result); 425 void Success(const std::string& result);
420 void Failure(const std::string& error); 426 void Failure(const std::string& error);
421 427
422 private: 428 private:
423 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetWifiTDLSEnabledStateFunction); 429 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetWifiTDLSEnabledStateFunction);
424 }; 430 };
425 431
426 // Implements the chrome.networkingPrivate.getWifiTDLSStatus method. 432 // Implements the chrome.networkingPrivate.getWifiTDLSStatus method.
427 class NetworkingPrivateGetWifiTDLSStatusFunction 433 class NetworkingPrivateGetWifiTDLSStatusFunction
428 : public AsyncExtensionFunction { 434 : public UIThreadExtensionFunction {
429 public: 435 public:
430 NetworkingPrivateGetWifiTDLSStatusFunction() {} 436 NetworkingPrivateGetWifiTDLSStatusFunction() {}
431 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getWifiTDLSStatus", 437 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getWifiTDLSStatus",
432 NETWORKINGPRIVATE_GETWIFITDLSSTATUS); 438 NETWORKINGPRIVATE_GETWIFITDLSSTATUS);
433 439
434 protected: 440 protected:
435 ~NetworkingPrivateGetWifiTDLSStatusFunction() override; 441 ~NetworkingPrivateGetWifiTDLSStatusFunction() override;
436 442
437 // AsyncExtensionFunction overrides. 443 // ExtensionFunction:
438 bool RunAsync() override; 444 ResponseAction Run() override;
439 445
440 void Success(const std::string& result); 446 void Success(const std::string& result);
441 void Failure(const std::string& error); 447 void Failure(const std::string& error);
442 448
443 private: 449 private:
444 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetWifiTDLSStatusFunction); 450 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetWifiTDLSStatusFunction);
445 }; 451 };
446 452
447 class NetworkingPrivateGetCaptivePortalStatusFunction 453 class NetworkingPrivateGetCaptivePortalStatusFunction
448 : public AsyncExtensionFunction { 454 : public UIThreadExtensionFunction {
449 public: 455 public:
450 NetworkingPrivateGetCaptivePortalStatusFunction() {} 456 NetworkingPrivateGetCaptivePortalStatusFunction() {}
451 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getCaptivePortalStatus", 457 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getCaptivePortalStatus",
452 NETWORKINGPRIVATE_GETCAPTIVEPORTALSTATUS); 458 NETWORKINGPRIVATE_GETCAPTIVEPORTALSTATUS);
453 459
454 // AsyncExtensionFunction overrides. 460 // ExtensionFunction:
455 bool RunAsync() override; 461 ResponseAction Run() override;
456 462
457 protected: 463 protected:
458 ~NetworkingPrivateGetCaptivePortalStatusFunction() override; 464 ~NetworkingPrivateGetCaptivePortalStatusFunction() override;
459 465
460 private: 466 private:
461 void Success(const std::string& result); 467 void Success(const std::string& result);
462 void Failure(const std::string& error); 468 void Failure(const std::string& error);
463 469
464 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetCaptivePortalStatusFunction); 470 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetCaptivePortalStatusFunction);
465 }; 471 };
466 472
467 class NetworkingPrivateUnlockCellularSimFunction 473 class NetworkingPrivateUnlockCellularSimFunction
468 : public AsyncExtensionFunction { 474 : public UIThreadExtensionFunction {
469 public: 475 public:
470 NetworkingPrivateUnlockCellularSimFunction() {} 476 NetworkingPrivateUnlockCellularSimFunction() {}
471 DECLARE_EXTENSION_FUNCTION("networkingPrivate.unlockCellularSim", 477 DECLARE_EXTENSION_FUNCTION("networkingPrivate.unlockCellularSim",
472 NETWORKINGPRIVATE_UNLOCKCELLULARSIM); 478 NETWORKINGPRIVATE_UNLOCKCELLULARSIM);
473 479
474 // AsyncExtensionFunction overrides. 480 // ExtensionFunction:
475 bool RunAsync() override; 481 ResponseAction Run() override;
476 482
477 protected: 483 protected:
478 ~NetworkingPrivateUnlockCellularSimFunction() override; 484 ~NetworkingPrivateUnlockCellularSimFunction() override;
479 485
480 private: 486 private:
481 void Success(); 487 void Success();
482 void Failure(const std::string& error); 488 void Failure(const std::string& error);
483 489
484 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateUnlockCellularSimFunction); 490 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateUnlockCellularSimFunction);
485 }; 491 };
486 492
487 class NetworkingPrivateSetCellularSimStateFunction 493 class NetworkingPrivateSetCellularSimStateFunction
488 : public AsyncExtensionFunction { 494 : public UIThreadExtensionFunction {
489 public: 495 public:
490 NetworkingPrivateSetCellularSimStateFunction() {} 496 NetworkingPrivateSetCellularSimStateFunction() {}
491 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setCellularSimState", 497 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setCellularSimState",
492 NETWORKINGPRIVATE_SETCELLULARSIMSTATE); 498 NETWORKINGPRIVATE_SETCELLULARSIMSTATE);
493 499
494 // AsyncExtensionFunction overrides. 500 // ExtensionFunction:
495 bool RunAsync() override; 501 ResponseAction Run() override;
496 502
497 protected: 503 protected:
498 ~NetworkingPrivateSetCellularSimStateFunction() override; 504 ~NetworkingPrivateSetCellularSimStateFunction() override;
499 505
500 private: 506 private:
501 void Success(); 507 void Success();
502 void Failure(const std::string& error); 508 void Failure(const std::string& error);
503 509
504 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetCellularSimStateFunction); 510 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetCellularSimStateFunction);
505 }; 511 };
(...skipping 11 matching lines...) Expand all
517 // ExtensionFunction: 523 // ExtensionFunction:
518 ResponseAction Run() override; 524 ResponseAction Run() override;
519 525
520 private: 526 private:
521 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetGlobalPolicyFunction); 527 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetGlobalPolicyFunction);
522 }; 528 };
523 529
524 } // namespace extensions 530 } // namespace extensions
525 531
526 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ 532 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698