Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Unified Diff: ios/web/public/web_view_creation_util.h

Issue 2627093003: Reuse context menu in StaticHTMLViewController (Closed)
Patch Set: feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698