1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_
10 #include "extensions/browser/extension_function.h"
12 namespace extensions
{
14 class VpnThreadExtensionFunction
: public UIThreadExtensionFunction
{
16 void SignalCallCompletionSuccess();
18 void SignalCallCompletionFailure(const std::string
& error_name
,
19 const std::string
& error_message
);
22 ~VpnThreadExtensionFunction() override
;
25 class VpnProviderCreateConfigFunction
: public VpnThreadExtensionFunction
{
27 DECLARE_EXTENSION_FUNCTION("vpnProvider.createConfig",
28 VPNPROVIDER_CREATECONFIG
);
31 ~VpnProviderCreateConfigFunction() override
;
33 ExtensionFunction::ResponseAction
Run() override
;
36 class VpnProviderDestroyConfigFunction
: public VpnThreadExtensionFunction
{
38 DECLARE_EXTENSION_FUNCTION("vpnProvider.destroyConfig",
39 VPNPROVIDER_DESTROYCONFIG
);
42 ~VpnProviderDestroyConfigFunction() override
;
44 ExtensionFunction::ResponseAction
Run() override
;
47 class VpnProviderSetParametersFunction
: public VpnThreadExtensionFunction
{
49 DECLARE_EXTENSION_FUNCTION("vpnProvider.setParameters",
50 VPNPROVIDER_SETPARAMETERS
);
53 ~VpnProviderSetParametersFunction() override
;
55 ExtensionFunction::ResponseAction
Run() override
;
58 class VpnProviderSendPacketFunction
: public VpnThreadExtensionFunction
{
60 DECLARE_EXTENSION_FUNCTION("vpnProvider.sendPacket", VPNPROVIDER_SENDPACKET
);
63 ~VpnProviderSendPacketFunction() override
;
65 ExtensionFunction::ResponseAction
Run() override
;
68 class VpnProviderNotifyConnectionStateChangedFunction
69 : public VpnThreadExtensionFunction
{
71 DECLARE_EXTENSION_FUNCTION("vpnProvider.notifyConnectionStateChanged",
72 VPNPROVIDER_NOTIFYCONNECTIONSTATECHANGED
);
75 ~VpnProviderNotifyConnectionStateChangedFunction() override
;
77 ExtensionFunction::ResponseAction
Run() override
;
80 } // namespace extensions
82 #endif // CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_