OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 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_ |
| 7 |
| 8 #include "extensions/browser/api/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" |
| 11 |
| 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 { |
| 17 |
| 18 class ChromeWebViewInternalContextMenusCreateFunction |
| 19 : public AsyncExtensionFunction { |
| 20 public: |
| 21 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusCreate", |
| 22 WEBVIEWINTERNAL_CONTEXTMENUSCREATE); |
| 23 ChromeWebViewInternalContextMenusCreateFunction() {} |
| 24 |
| 25 protected: |
| 26 virtual ~ChromeWebViewInternalContextMenusCreateFunction() {} |
| 27 |
| 28 // ExtensionFunction implementation. |
| 29 virtual bool RunAsync() OVERRIDE; |
| 30 |
| 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusCreateFunction); |
| 33 }; |
| 34 |
| 35 class ChromeWebViewInternalContextMenusUpdateFunction |
| 36 : public AsyncExtensionFunction { |
| 37 public: |
| 38 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusUpdate", |
| 39 WEBVIEWINTERNAL_CONTEXTMENUSUPDATE); |
| 40 ChromeWebViewInternalContextMenusUpdateFunction() {} |
| 41 |
| 42 protected: |
| 43 virtual ~ChromeWebViewInternalContextMenusUpdateFunction() {} |
| 44 |
| 45 // ExtensionFunction implementation. |
| 46 virtual bool RunAsync() OVERRIDE; |
| 47 |
| 48 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusUpdateFunction); |
| 50 }; |
| 51 |
| 52 class ChromeWebViewInternalContextMenusRemoveFunction |
| 53 : public AsyncExtensionFunction { |
| 54 public: |
| 55 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusRemove", |
| 56 WEBVIEWINTERNAL_CONTEXTMENUSREMOVE); |
| 57 ChromeWebViewInternalContextMenusRemoveFunction() {} |
| 58 |
| 59 protected: |
| 60 virtual ~ChromeWebViewInternalContextMenusRemoveFunction() {} |
| 61 |
| 62 // ExtensionFunction implementation. |
| 63 virtual bool RunAsync() OVERRIDE; |
| 64 |
| 65 private: |
| 66 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveFunction); |
| 67 }; |
| 68 |
| 69 class ChromeWebViewInternalContextMenusRemoveAllFunction |
| 70 : public AsyncExtensionFunction { |
| 71 public: |
| 72 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.contextMenusRemoveAll", |
| 73 WEBVIEWINTERNAL_CONTEXTMENUSREMOVEALL); |
| 74 ChromeWebViewInternalContextMenusRemoveAllFunction() {} |
| 75 |
| 76 protected: |
| 77 virtual ~ChromeWebViewInternalContextMenusRemoveAllFunction() {} |
| 78 |
| 79 // ExtensionFunction implementation. |
| 80 virtual bool RunAsync() OVERRIDE; |
| 81 |
| 82 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveAllFunction); |
| 84 }; |
| 85 |
| 86 class ChromeWebViewInternalClearDataFunction |
| 87 : public WebViewInternalExtensionFunction { |
| 88 public: |
| 89 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.clearData", |
| 90 WEBVIEWINTERNAL_CLEARDATA); |
| 91 |
| 92 ChromeWebViewInternalClearDataFunction(); |
| 93 |
| 94 protected: |
| 95 virtual ~ChromeWebViewInternalClearDataFunction(); |
| 96 |
| 97 private: |
| 98 // WebViewInternalExtensionFunction implementation. |
| 99 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; |
| 100 |
| 101 uint32 GetRemovalMask(); |
| 102 void ClearDataDone(); |
| 103 |
| 104 // Removal start time. |
| 105 base::Time remove_since_; |
| 106 // Removal mask, corresponds to StoragePartition::RemoveDataMask enum. |
| 107 uint32 remove_mask_; |
| 108 // Tracks any data related or parse errors. |
| 109 bool bad_message_; |
| 110 |
| 111 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalClearDataFunction); |
| 112 }; |
| 113 |
| 114 class ChromeWebViewInternalShowContextMenuFunction |
| 115 : public WebViewInternalExtensionFunction { |
| 116 public: |
| 117 DECLARE_EXTENSION_FUNCTION("chromeWebViewInternal.showContextMenu", |
| 118 WEBVIEWINTERNAL_SHOWCONTEXTMENU); |
| 119 |
| 120 ChromeWebViewInternalShowContextMenuFunction(); |
| 121 |
| 122 protected: |
| 123 virtual ~ChromeWebViewInternalShowContextMenuFunction(); |
| 124 |
| 125 private: |
| 126 // WebViewInternalExtensionFunction implementation. |
| 127 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; |
| 128 |
| 129 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalShowContextMenuFunction); |
| 130 }; |
| 131 |
| 132 } // namespace extensions |
| 133 |
| 134 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_CHROME_WEB_VIEW_INTERNAL_API_H
_ |
OLD | NEW |