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

Side by Side Diff: ios/web_view/public/cwv_ui_delegate.h

Issue 2715343002: Add JavaScript prompts support to CWVUIDelegate. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_ 5 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_
6 #define IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_ 6 #define IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_
7 7
8 #import <CoreGraphics/CGGeometry.h> 8 #import <CoreGraphics/CGGeometry.h>
9 9
10 @class CWVHTMLElement; 10 @class CWVHTMLElement;
11 @class CWVWebView; 11 @class CWVWebView;
12 @class NSString; 12 @class NSString;
13 @class UIView; 13 @class UIView;
14 14
15 // UI delegate interface for a CWVWebView. Embedders can implement the 15 // UI delegate interface for a CWVWebView. Embedders can implement the
16 // functions in order to customize library behavior. 16 // functions in order to customize library behavior.
17 @protocol CWVUIDelegate<NSObject> 17 @protocol CWVUIDelegate<NSObject>
18 18
19 @optional 19 @optional
20 // Instructs the delegate to present context menu in response to user’s long 20 // Instructs the delegate to present context menu in response to user’s long
21 // press gesture at |location| in |view| coordinate space. |element| is an HTML 21 // press gesture at |location| in |view| coordinate space. |element| is an HTML
22 // element which received the gesture. 22 // element which received the gesture.
23 - (void)webView:(CWVWebView*)webView 23 - (void)webView:(CWVWebView*)webView
24 runContextMenuWithTitle:(NSString*)menuTitle 24 runContextMenuWithTitle:(NSString*)menuTitle
25 forHTMLElement:(CWVHTMLElement*)element 25 forHTMLElement:(CWVHTMLElement*)element
26 inView:(UIView*)view 26 inView:(UIView*)view
27 userGestureLocation:(CGPoint)location; 27 userGestureLocation:(CGPoint)location;
28 28
29 // Instructs the delegate to show UI in response to window.alert JavaScript
30 // call.
31 - (void)webView:(CWVWebView*)webView
32 runJavaScriptAlertPanelWithMessage:(NSString*)message
33 pageURL:(NSURL*)URL
34 completionHandler:(void (^)(void))handler;
Eugene But (OOO till 7-30) 2017/02/27 18:30:52 s/handler/completionHandler
michaeldo 2017/02/27 21:35:51 Done.
35
36 // Instructs the delegate to show UI in response to
37 // window.confirm JavaScript call.
38 - (void)webView:(CWVWebView*)webView
39 runJavaScriptConfirmPanelWithMessage:(NSString*)message
40 pageURL:(NSURL*)URL
41 completionHandler:(void (^)(BOOL))handler;
42
43 // Instructs the delegate to show UI in response to window.prompt
44 // JavaScript call.
45 - (void)webView:(CWVWebView*)webView
46 runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
47 defaultText:(NSString*)defaultText
48 pageURL:(NSURL*)URL
49 completionHandler:(void (^)(NSString*))handler;
50
51 // Instructs the delegate to cancel all current javascript prompts.
52 - (void)cancelDialogsForWebView:(CWVWebView*)webView;
Eugene But (OOO till 7-30) 2017/02/27 18:30:52 Can we remove this method? It's quite unclear when
michaeldo 2017/02/27 21:35:51 I have removed this method. It is only called when
Eugene But (OOO till 7-30) 2017/02/27 22:01:05 I still see this method in the header. Please doub
michaeldo 2017/02/27 23:39:15 Done.
53
29 @end 54 @end
30 55
31 #endif // IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_ 56 #endif // IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698