| 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_WEB_VIEW_CHROME_WEB_VIEW_INTERNAL_API_H_ | 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_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_CHROME_WEB_VIEW_INTERNAL_API_H_ |
| 7 | 7 |
| 8 #include "extensions/browser/api/web_view/web_view_internal_api.h" | 8 #include "extensions/browser/api/web_view/web_view_internal_api.h" |
| 9 #include "extensions/browser/extension_function.h" | 9 #include "extensions/browser/extension_function.h" |
| 10 #include "extensions/browser/guest_view/web_view/web_view_guest.h" | 10 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 11 | 11 |
| 12 // WARNING: *WebViewInternal could be loaded in an unblessed context, thus any | 12 // WARNING: *WebViewInternal could be loaded in an unblessed context, thus any |
| 13 // new APIs must extend WebViewInternalExtensionFunction or | 13 // new APIs must extend WebViewInternalExtensionFunction or |
| 14 // WebViewInternalExecuteCodeFunction which do a process ID check to prevent | 14 // WebViewInternalExecuteCodeFunction which do a process ID check to prevent |
| 15 // abuse by normal renderer processes. | 15 // abuse by normal renderer processes. |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 class ChromeWebViewInternalContextMenusCreateFunction | 18 class ChromeWebViewInternalContextMenusCreateFunction |
| 19 : public AsyncExtensionFunction { | 19 : public AsyncExtensionFunction { |
| 20 public: | 20 public: |
| 21 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusCreate", | 21 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusCreate", |
| 22 WEBVIEWINTERNAL_CONTEXTMENUSCREATE); | 22 WEBVIEWINTERNAL_CONTEXTMENUSCREATE); |
| 23 ChromeWebViewInternalContextMenusCreateFunction() {} | 23 ChromeWebViewInternalContextMenusCreateFunction() {} |
| 24 | 24 |
| 25 protected: | 25 protected: |
| 26 virtual ~ChromeWebViewInternalContextMenusCreateFunction() {} | 26 virtual ~ChromeWebViewInternalContextMenusCreateFunction() {} |
| 27 | 27 |
| 28 // ExtensionFunction implementation. | 28 // ExtensionFunction implementation. |
| 29 virtual bool RunAsync() OVERRIDE; | 29 virtual bool RunAsync() override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusCreateFunction); | 32 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusCreateFunction); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class ChromeWebViewInternalContextMenusUpdateFunction | 35 class ChromeWebViewInternalContextMenusUpdateFunction |
| 36 : public AsyncExtensionFunction { | 36 : public AsyncExtensionFunction { |
| 37 public: | 37 public: |
| 38 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusUpdate", | 38 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusUpdate", |
| 39 WEBVIEWINTERNAL_CONTEXTMENUSUPDATE); | 39 WEBVIEWINTERNAL_CONTEXTMENUSUPDATE); |
| 40 ChromeWebViewInternalContextMenusUpdateFunction() {} | 40 ChromeWebViewInternalContextMenusUpdateFunction() {} |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 virtual ~ChromeWebViewInternalContextMenusUpdateFunction() {} | 43 virtual ~ChromeWebViewInternalContextMenusUpdateFunction() {} |
| 44 | 44 |
| 45 // ExtensionFunction implementation. | 45 // ExtensionFunction implementation. |
| 46 virtual bool RunAsync() OVERRIDE; | 46 virtual bool RunAsync() override; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusUpdateFunction); | 49 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusUpdateFunction); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class ChromeWebViewInternalContextMenusRemoveFunction | 52 class ChromeWebViewInternalContextMenusRemoveFunction |
| 53 : public AsyncExtensionFunction { | 53 : public AsyncExtensionFunction { |
| 54 public: | 54 public: |
| 55 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusRemove", | 55 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusRemove", |
| 56 WEBVIEWINTERNAL_CONTEXTMENUSREMOVE); | 56 WEBVIEWINTERNAL_CONTEXTMENUSREMOVE); |
| 57 ChromeWebViewInternalContextMenusRemoveFunction() {} | 57 ChromeWebViewInternalContextMenusRemoveFunction() {} |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 virtual ~ChromeWebViewInternalContextMenusRemoveFunction() {} | 60 virtual ~ChromeWebViewInternalContextMenusRemoveFunction() {} |
| 61 | 61 |
| 62 // ExtensionFunction implementation. | 62 // ExtensionFunction implementation. |
| 63 virtual bool RunAsync() OVERRIDE; | 63 virtual bool RunAsync() override; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveFunction); | 66 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveFunction); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class ChromeWebViewInternalContextMenusRemoveAllFunction | 69 class ChromeWebViewInternalContextMenusRemoveAllFunction |
| 70 : public AsyncExtensionFunction { | 70 : public AsyncExtensionFunction { |
| 71 public: | 71 public: |
| 72 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusRemoveAll", | 72 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusRemoveAll", |
| 73 WEBVIEWINTERNAL_CONTEXTMENUSREMOVEALL); | 73 WEBVIEWINTERNAL_CONTEXTMENUSREMOVEALL); |
| 74 ChromeWebViewInternalContextMenusRemoveAllFunction() {} | 74 ChromeWebViewInternalContextMenusRemoveAllFunction() {} |
| 75 | 75 |
| 76 protected: | 76 protected: |
| 77 virtual ~ChromeWebViewInternalContextMenusRemoveAllFunction() {} | 77 virtual ~ChromeWebViewInternalContextMenusRemoveAllFunction() {} |
| 78 | 78 |
| 79 // ExtensionFunction implementation. | 79 // ExtensionFunction implementation. |
| 80 virtual bool RunAsync() OVERRIDE; | 80 virtual bool RunAsync() override; |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveAllFunction); | 83 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveAllFunction); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class ChromeWebViewInternalShowContextMenuFunction | 86 class ChromeWebViewInternalShowContextMenuFunction |
| 87 : public WebViewInternalExtensionFunction { | 87 : public WebViewInternalExtensionFunction { |
| 88 public: | 88 public: |
| 89 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.showContextMenu", | 89 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.showContextMenu", |
| 90 WEBVIEWINTERNAL_SHOWCONTEXTMENU); | 90 WEBVIEWINTERNAL_SHOWCONTEXTMENU); |
| 91 | 91 |
| 92 ChromeWebViewInternalShowContextMenuFunction(); | 92 ChromeWebViewInternalShowContextMenuFunction(); |
| 93 | 93 |
| 94 protected: | 94 protected: |
| 95 virtual ~ChromeWebViewInternalShowContextMenuFunction(); | 95 virtual ~ChromeWebViewInternalShowContextMenuFunction(); |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 // WebViewInternalExtensionFunction implementation. | 98 // WebViewInternalExtensionFunction implementation. |
| 99 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 99 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalShowContextMenuFunction); | 101 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalShowContextMenuFunction); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace extensions | 104 } // namespace extensions |
| 105 | 105 |
| 106 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_CHROME_WEB_VIEW_INTERNAL_API_H
_ | 106 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_CHROME_WEB_VIEW_INTERNAL_API_H
_ |
| OLD | NEW |