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();
17 void SignalCallCompletionSuccessWithId(const std::string
& configuration_id
);
18 void SignalCallCompletionSuccessWithWarning(const std::string
& warning
);
20 void SignalCallCompletionFailure(const std::string
& error_name
,
21 const std::string
& error_message
);
24 ~VpnThreadExtensionFunction() override
;
27 class VpnProviderCreateConfigFunction
: public VpnThreadExtensionFunction
{
29 DECLARE_EXTENSION_FUNCTION("vpnProvider.createConfig",
30 VPNPROVIDER_CREATECONFIG
);
33 ~VpnProviderCreateConfigFunction() override
;
35 ExtensionFunction::ResponseAction
Run() override
;
38 class VpnProviderDestroyConfigFunction
: public VpnThreadExtensionFunction
{
40 DECLARE_EXTENSION_FUNCTION("vpnProvider.destroyConfig",
41 VPNPROVIDER_DESTROYCONFIG
);
44 ~VpnProviderDestroyConfigFunction() override
;
46 ExtensionFunction::ResponseAction
Run() override
;
49 class VpnProviderSetParametersFunction
: public VpnThreadExtensionFunction
{
51 DECLARE_EXTENSION_FUNCTION("vpnProvider.setParameters",
52 VPNPROVIDER_SETPARAMETERS
);
55 ~VpnProviderSetParametersFunction() override
;
57 ExtensionFunction::ResponseAction
Run() override
;
60 class VpnProviderSendPacketFunction
: public VpnThreadExtensionFunction
{
62 DECLARE_EXTENSION_FUNCTION("vpnProvider.sendPacket", VPNPROVIDER_SENDPACKET
);
65 ~VpnProviderSendPacketFunction() override
;
67 ExtensionFunction::ResponseAction
Run() override
;
70 class VpnProviderNotifyConnectionStateChangedFunction
71 : public VpnThreadExtensionFunction
{
73 DECLARE_EXTENSION_FUNCTION("vpnProvider.notifyConnectionStateChanged",
74 VPNPROVIDER_NOTIFYCONNECTIONSTATECHANGED
);
77 ~VpnProviderNotifyConnectionStateChangedFunction() override
;
79 ExtensionFunction::ResponseAction
Run() override
;
82 } // namespace extensions
84 #endif // CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_