Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / extensions / api / web_view / chrome_web_view_internal_api.h
blob8b2ad3cea9bb76ed3b498385957e854d976ad673
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_WEB_VIEW_CHROME_WEB_VIEW_INTERNAL_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_CHROME_WEB_VIEW_INTERNAL_API_H_
8 #include "extensions/browser/api/guest_view/web_view/web_view_internal_api.h"
9 #include "extensions/browser/extension_function.h"
10 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
12 // WARNING: *WebViewInternal could be loaded in an unblessed context, thus any
13 // new APIs must extend WebViewInternalExtensionFunction or
14 // WebViewInternalExecuteCodeFunction which do a process ID check to prevent
15 // abuse by normal renderer processes.
16 namespace extensions {
18 class ChromeWebViewInternalContextMenusCreateFunction
19 : public AsyncExtensionFunction {
20 public:
21 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusCreate",
22 WEBVIEWINTERNAL_CONTEXTMENUSCREATE);
23 ChromeWebViewInternalContextMenusCreateFunction() {}
25 protected:
26 ~ChromeWebViewInternalContextMenusCreateFunction() override {}
28 // ExtensionFunction implementation.
29 bool RunAsync() override;
31 private:
32 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusCreateFunction);
35 class ChromeWebViewInternalContextMenusUpdateFunction
36 : public AsyncExtensionFunction {
37 public:
38 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusUpdate",
39 WEBVIEWINTERNAL_CONTEXTMENUSUPDATE);
40 ChromeWebViewInternalContextMenusUpdateFunction() {}
42 protected:
43 ~ChromeWebViewInternalContextMenusUpdateFunction() override {}
45 // ExtensionFunction implementation.
46 bool RunAsync() override;
48 private:
49 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusUpdateFunction);
52 class ChromeWebViewInternalContextMenusRemoveFunction
53 : public AsyncExtensionFunction {
54 public:
55 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusRemove",
56 WEBVIEWINTERNAL_CONTEXTMENUSREMOVE);
57 ChromeWebViewInternalContextMenusRemoveFunction() {}
59 protected:
60 ~ChromeWebViewInternalContextMenusRemoveFunction() override {}
62 // ExtensionFunction implementation.
63 bool RunAsync() override;
65 private:
66 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveFunction);
69 class ChromeWebViewInternalContextMenusRemoveAllFunction
70 : public AsyncExtensionFunction {
71 public:
72 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusRemoveAll",
73 WEBVIEWINTERNAL_CONTEXTMENUSREMOVEALL);
74 ChromeWebViewInternalContextMenusRemoveAllFunction() {}
76 protected:
77 ~ChromeWebViewInternalContextMenusRemoveAllFunction() override {}
79 // ExtensionFunction implementation.
80 bool RunAsync() override;
82 private:
83 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveAllFunction);
86 class ChromeWebViewInternalShowContextMenuFunction
87 : public WebViewInternalExtensionFunction {
88 public:
89 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.showContextMenu",
90 WEBVIEWINTERNAL_SHOWCONTEXTMENU);
92 ChromeWebViewInternalShowContextMenuFunction();
94 protected:
95 ~ChromeWebViewInternalShowContextMenuFunction() override;
97 private:
98 // WebViewInternalExtensionFunction implementation.
99 bool RunAsyncSafe(WebViewGuest* guest) override;
101 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalShowContextMenuFunction);
104 } // namespace extensions
106 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_CHROME_WEB_VIEW_INTERNAL_API_H_