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

Unified Diff: ios/web_view/public/cwv_ui_delegate.h

Issue 2723433004: Add CWVUIDelegate with method to customize context menu. (Closed)
Patch Set: Created 3 years, 10 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_view/public/cwv_ui_delegate.h
diff --git a/ios/web_view/public/cwv_ui_delegate.h b/ios/web_view/public/cwv_ui_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..79de5853167b1d692e410d2c3c057bf06b1bfd2e
--- /dev/null
+++ b/ios/web_view/public/cwv_ui_delegate.h
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_
+#define IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_
+
+#import <CoreGraphics/CGGeometry.h>
Eugene But (OOO till 7-30) 2017/02/27 16:34:06 <CoreGraphics/CoreGraphics.h> https://google.gith
michaeldo 2017/02/27 19:02:06 Done.
+
+@class CWVHTMLElement;
+@class CWVWebView;
+@class NSString;
Eugene But (OOO till 7-30) 2017/02/27 16:34:06 Optional nit: How about importing UIKit instead of
michaeldo 2017/02/27 19:02:06 Done.
+@class UIView;
+
+// UI delegate interface for a CWVWebView. Embedders can implement the
+// functions in order to customize library behavior.
+@protocol CWVUIDelegate<NSObject>
+
+@optional
+// Instructs the delegate to present context menu in response to user’s long
+// press gesture at |location| in |view| coordinate space. |element| is an HTML
+// element which received the gesture.
+- (void)webView:(CWVWebView*)webView
+ runContextMenuWithTitle:(NSString*)menuTitle
+ forHTMLElement:(CWVHTMLElement*)element
+ inView:(UIView*)view
+ userGestureLocation:(CGPoint)location;
+
+@end
+
+#endif // IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698