Index: ios/web/public/web_view_creation_util.h |
diff --git a/ios/web/public/web_view_creation_util.h b/ios/web/public/web_view_creation_util.h |
index 9b27d8b8f828bfe79849fb2c70dbf0de9df3d125..f16b90ad67637dc3d29ab1c2fd17490df23f9ccb 100644 |
--- a/ios/web/public/web_view_creation_util.h |
+++ b/ios/web/public/web_view_creation_util.h |
@@ -8,6 +8,7 @@ |
#import <CoreGraphics/CoreGraphics.h> |
#import <Foundation/Foundation.h> |
+@protocol CRWContextMenuDelegate; |
@class WKWebView; |
namespace web { |
@@ -23,6 +24,19 @@ class BrowserState; |
// |
WKWebView* BuildWKWebView(CGRect frame, BrowserState* browser_state); |
+// Returns a new WKWebView for displaying regular web content. |
+// The returned WKWebView is equivalent to the one created by |BuildWKWebView| |
+// but a context menu recognizer is attached to it. |
+// On a long press, context_menu_delegate webView:handleContextMenu:| is called. |
+// The custom context menu involves gesture recognizers on every touch and |
+// JavaScript. It can have impact on performances. |
+// Calling |BuildWKWebViewWithCustomContextMenu| with a |context_menu_delegate| |
+// nil is equivalent to |BuildWKWebView|. |
+WKWebView* BuildWKWebViewWithCustomContextMenu( |
+ CGRect frame, |
+ BrowserState* browser_state, |
+ id<CRWContextMenuDelegate> context_menu_delegate); |
+ |
} // web |
#endif // IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_ |