OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "extensions/browser/extension_function.h" | 10 #include "extensions/browser/extension_function.h" |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 | 13 |
14 class VpnThreadExtensionFunction : public UIThreadExtensionFunction { | 14 class VpnThreadExtensionFunction : public UIThreadExtensionFunction { |
15 public: | 15 public: |
16 void SignalCallCompletionSuccess(); | 16 void SignalCallCompletionSuccess(); |
17 | 17 |
18 void SignalCallCompletionFailure(const std::string& error_name, | 18 void SignalCallCompletionFailure(const std::string& error_name, |
19 const std::string& error_message); | 19 const std::string& error_message); |
20 | 20 |
21 protected: | 21 protected: |
22 virtual ~VpnThreadExtensionFunction(); | 22 ~VpnThreadExtensionFunction() override; |
23 }; | 23 }; |
24 | 24 |
25 class VpnProviderCreateConfigFunction : public VpnThreadExtensionFunction { | 25 class VpnProviderCreateConfigFunction : public VpnThreadExtensionFunction { |
26 public: | 26 public: |
27 DECLARE_EXTENSION_FUNCTION("vpnProvider.createConfig", | 27 DECLARE_EXTENSION_FUNCTION("vpnProvider.createConfig", |
28 VPNPROVIDER_CREATECONFIG); | 28 VPNPROVIDER_CREATECONFIG); |
29 | 29 |
30 protected: | 30 protected: |
31 virtual ~VpnProviderCreateConfigFunction(); | 31 ~VpnProviderCreateConfigFunction() override; |
32 | 32 |
33 virtual ExtensionFunction::ResponseAction Run() override; | 33 ExtensionFunction::ResponseAction Run() override; |
34 }; | 34 }; |
35 | 35 |
36 class VpnProviderDestroyConfigFunction : public VpnThreadExtensionFunction { | 36 class VpnProviderDestroyConfigFunction : public VpnThreadExtensionFunction { |
37 public: | 37 public: |
38 DECLARE_EXTENSION_FUNCTION("vpnProvider.destroyConfig", | 38 DECLARE_EXTENSION_FUNCTION("vpnProvider.destroyConfig", |
39 VPNPROVIDER_DESTROYCONFIG); | 39 VPNPROVIDER_DESTROYCONFIG); |
40 | 40 |
41 protected: | 41 protected: |
42 virtual ~VpnProviderDestroyConfigFunction(); | 42 ~VpnProviderDestroyConfigFunction() override; |
43 | 43 |
44 virtual ExtensionFunction::ResponseAction Run() override; | 44 ExtensionFunction::ResponseAction Run() override; |
45 }; | 45 }; |
46 | 46 |
47 class VpnProviderSetParametersFunction : public VpnThreadExtensionFunction { | 47 class VpnProviderSetParametersFunction : public VpnThreadExtensionFunction { |
48 public: | 48 public: |
49 DECLARE_EXTENSION_FUNCTION("vpnProvider.setParameters", | 49 DECLARE_EXTENSION_FUNCTION("vpnProvider.setParameters", |
50 VPNPROVIDER_SETPARAMETERS); | 50 VPNPROVIDER_SETPARAMETERS); |
51 | 51 |
52 protected: | 52 protected: |
53 virtual ~VpnProviderSetParametersFunction(); | 53 ~VpnProviderSetParametersFunction() override; |
54 | 54 |
55 virtual ExtensionFunction::ResponseAction Run() override; | 55 ExtensionFunction::ResponseAction Run() override; |
56 }; | 56 }; |
57 | 57 |
58 class VpnProviderSendPacketFunction : public VpnThreadExtensionFunction { | 58 class VpnProviderSendPacketFunction : public VpnThreadExtensionFunction { |
59 public: | 59 public: |
60 DECLARE_EXTENSION_FUNCTION("vpnProvider.sendPacket", VPNPROVIDER_SENDPACKET); | 60 DECLARE_EXTENSION_FUNCTION("vpnProvider.sendPacket", VPNPROVIDER_SENDPACKET); |
61 | 61 |
62 protected: | 62 protected: |
63 virtual ~VpnProviderSendPacketFunction(); | 63 ~VpnProviderSendPacketFunction() override; |
64 | 64 |
65 virtual ExtensionFunction::ResponseAction Run() override; | 65 ExtensionFunction::ResponseAction Run() override; |
66 }; | 66 }; |
67 | 67 |
68 class VpnProviderNotifyConnectionStateChangedFunction | 68 class VpnProviderNotifyConnectionStateChangedFunction |
69 : public VpnThreadExtensionFunction { | 69 : public VpnThreadExtensionFunction { |
70 public: | 70 public: |
71 DECLARE_EXTENSION_FUNCTION("vpnProvider.notifyConnectionStateChanged", | 71 DECLARE_EXTENSION_FUNCTION("vpnProvider.notifyConnectionStateChanged", |
72 VPNPROVIDER_NOTIFYCONNECTIONSTATECHANGED); | 72 VPNPROVIDER_NOTIFYCONNECTIONSTATECHANGED); |
73 | 73 |
74 protected: | 74 protected: |
75 virtual ~VpnProviderNotifyConnectionStateChangedFunction(); | 75 ~VpnProviderNotifyConnectionStateChangedFunction() override; |
76 | 76 |
77 virtual ExtensionFunction::ResponseAction Run() override; | 77 ExtensionFunction::ResponseAction Run() override; |
78 }; | 78 }; |
79 | 79 |
80 } // namespace extensions | 80 } // namespace extensions |
81 | 81 |
82 #endif // CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_ | 82 #endif // CHROME_BROWSER_EXTENSIONS_API_VPN_PROVIDER_VPN_PROVIDER_API_H_ |
OLD | NEW |