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

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

Issue 2261313002: [Extensions] Convert some SyncExtensionFunctions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ready Created 4 years, 3 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
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 private: 184 private:
185 void Success(std::unique_ptr<base::ListValue> network_list); 185 void Success(std::unique_ptr<base::ListValue> network_list);
186 void Failure(const std::string& error); 186 void Failure(const std::string& error);
187 187
188 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction); 188 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction);
189 }; 189 };
190 190
191 // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method. 191 // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method.
192 class NetworkingPrivateGetEnabledNetworkTypesFunction 192 class NetworkingPrivateGetEnabledNetworkTypesFunction
193 : public SyncExtensionFunction { 193 : public UIThreadExtensionFunction {
194 public: 194 public:
195 NetworkingPrivateGetEnabledNetworkTypesFunction() {} 195 NetworkingPrivateGetEnabledNetworkTypesFunction() {}
196 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getEnabledNetworkTypes", 196 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getEnabledNetworkTypes",
197 NETWORKINGPRIVATE_GETENABLEDNETWORKTYPES); 197 NETWORKINGPRIVATE_GETENABLEDNETWORKTYPES);
198 198
199 protected: 199 protected:
200 ~NetworkingPrivateGetEnabledNetworkTypesFunction() override; 200 ~NetworkingPrivateGetEnabledNetworkTypesFunction() override;
201 201
202 // SyncExtensionFunction overrides. 202 // ExtensionFunction:
203 bool RunSync() override; 203 ResponseAction Run() override;
204 204
205 private: 205 private:
206 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetEnabledNetworkTypesFunction); 206 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetEnabledNetworkTypesFunction);
207 }; 207 };
208 208
209 // Implements the chrome.networkingPrivate.getDeviceStates method. 209 // Implements the chrome.networkingPrivate.getDeviceStates method.
210 class NetworkingPrivateGetDeviceStatesFunction : public SyncExtensionFunction { 210 class NetworkingPrivateGetDeviceStatesFunction
211 : public UIThreadExtensionFunction {
211 public: 212 public:
212 NetworkingPrivateGetDeviceStatesFunction() {} 213 NetworkingPrivateGetDeviceStatesFunction() {}
213 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getDeviceStates", 214 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getDeviceStates",
214 NETWORKINGPRIVATE_GETDEVICESTATES); 215 NETWORKINGPRIVATE_GETDEVICESTATES);
215 216
216 protected: 217 protected:
217 ~NetworkingPrivateGetDeviceStatesFunction() override; 218 ~NetworkingPrivateGetDeviceStatesFunction() override;
218 219
219 // SyncExtensionFunction overrides. 220 // ExtensionFunction:
220 bool RunSync() override; 221 ResponseAction Run() override;
221 222
222 private: 223 private:
223 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetDeviceStatesFunction); 224 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetDeviceStatesFunction);
224 }; 225 };
225 226
226 // Implements the chrome.networkingPrivate.enableNetworkType method. 227 // Implements the chrome.networkingPrivate.enableNetworkType method.
227 class NetworkingPrivateEnableNetworkTypeFunction 228 class NetworkingPrivateEnableNetworkTypeFunction
228 : public SyncExtensionFunction { 229 : public UIThreadExtensionFunction {
229 public: 230 public:
230 NetworkingPrivateEnableNetworkTypeFunction() {} 231 NetworkingPrivateEnableNetworkTypeFunction() {}
231 DECLARE_EXTENSION_FUNCTION("networkingPrivate.enableNetworkType", 232 DECLARE_EXTENSION_FUNCTION("networkingPrivate.enableNetworkType",
232 NETWORKINGPRIVATE_ENABLENETWORKTYPE); 233 NETWORKINGPRIVATE_ENABLENETWORKTYPE);
233 234
234 protected: 235 protected:
235 ~NetworkingPrivateEnableNetworkTypeFunction() override; 236 ~NetworkingPrivateEnableNetworkTypeFunction() override;
236 237
237 // SyncExtensionFunction overrides. 238 // ExtensionFunction:
238 bool RunSync() override; 239 ResponseAction Run() override;
239 240
240 private: 241 private:
241 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEnableNetworkTypeFunction); 242 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEnableNetworkTypeFunction);
242 }; 243 };
243 244
244 // Implements the chrome.networkingPrivate.disableNetworkType method. 245 // Implements the chrome.networkingPrivate.disableNetworkType method.
245 class NetworkingPrivateDisableNetworkTypeFunction 246 class NetworkingPrivateDisableNetworkTypeFunction
246 : public SyncExtensionFunction { 247 : public UIThreadExtensionFunction {
247 public: 248 public:
248 NetworkingPrivateDisableNetworkTypeFunction() {} 249 NetworkingPrivateDisableNetworkTypeFunction() {}
249 DECLARE_EXTENSION_FUNCTION("networkingPrivate.disableNetworkType", 250 DECLARE_EXTENSION_FUNCTION("networkingPrivate.disableNetworkType",
250 NETWORKINGPRIVATE_DISABLENETWORKTYPE); 251 NETWORKINGPRIVATE_DISABLENETWORKTYPE);
251 252
252 protected: 253 protected:
253 ~NetworkingPrivateDisableNetworkTypeFunction() override; 254 ~NetworkingPrivateDisableNetworkTypeFunction() override;
254 255
255 // SyncExtensionFunction overrides. 256 // ExtensionFunction:
256 bool RunSync() override; 257 ResponseAction Run() override;
257 258
258 private: 259 private:
259 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDisableNetworkTypeFunction); 260 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDisableNetworkTypeFunction);
260 }; 261 };
261 262
262 // Implements the chrome.networkingPrivate.requestNetworkScan method. 263 // Implements the chrome.networkingPrivate.requestNetworkScan method.
263 class NetworkingPrivateRequestNetworkScanFunction 264 class NetworkingPrivateRequestNetworkScanFunction
264 : public SyncExtensionFunction { 265 : public UIThreadExtensionFunction {
265 public: 266 public:
266 NetworkingPrivateRequestNetworkScanFunction() {} 267 NetworkingPrivateRequestNetworkScanFunction() {}
267 DECLARE_EXTENSION_FUNCTION("networkingPrivate.requestNetworkScan", 268 DECLARE_EXTENSION_FUNCTION("networkingPrivate.requestNetworkScan",
268 NETWORKINGPRIVATE_REQUESTNETWORKSCAN); 269 NETWORKINGPRIVATE_REQUESTNETWORKSCAN);
269 270
270 protected: 271 protected:
271 ~NetworkingPrivateRequestNetworkScanFunction() override; 272 ~NetworkingPrivateRequestNetworkScanFunction() override;
272 273
273 // SyncExtensionFunction overrides. 274 // ExtensionFunction:
274 bool RunSync() override; 275 ResponseAction Run() override;
275 276
276 private: 277 private:
277 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateRequestNetworkScanFunction); 278 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateRequestNetworkScanFunction);
278 }; 279 };
279 280
280 // Implements the chrome.networkingPrivate.startConnect method. 281 // Implements the chrome.networkingPrivate.startConnect method.
281 class NetworkingPrivateStartConnectFunction : public AsyncExtensionFunction { 282 class NetworkingPrivateStartConnectFunction : public AsyncExtensionFunction {
282 public: 283 public:
283 NetworkingPrivateStartConnectFunction() {} 284 NetworkingPrivateStartConnectFunction() {}
284 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startConnect", 285 DECLARE_EXTENSION_FUNCTION("networkingPrivate.startConnect",
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 private: 500 private:
500 void Success(); 501 void Success();
501 void Failure(const std::string& error); 502 void Failure(const std::string& error);
502 503
503 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetCellularSimStateFunction); 504 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetCellularSimStateFunction);
504 }; 505 };
505 506
506 } // namespace extensions 507 } // namespace extensions
507 508
508 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ 509 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698