| OLD | NEW |
| 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/CoreGraphics.h> | 8 #import <CoreGraphics/CoreGraphics.h> |
| 9 #import <UIKit/UIKit.h> | 9 #import <UIKit/UIKit.h> |
| 10 | 10 |
| 11 @class CWVHTMLElement; | 11 @class CWVHTMLElement; |
| 12 @class CWVWebView; | 12 @class CWVWebView; |
| 13 | 13 |
| 14 // UI delegate interface for a CWVWebView. Embedders can implement the | 14 // UI delegate interface for a CWVWebView. Embedders can implement the |
| 15 // functions in order to customize library behavior. | 15 // functions in order to customize library behavior. |
| 16 @protocol CWVUIDelegate<NSObject> | 16 @protocol CWVUIDelegate<NSObject> |
| 17 | 17 |
| 18 @optional | 18 @optional |
| 19 // Instructs the delegate to present context menu in response to user’s long | 19 // Instructs the delegate to present context menu in response to user’s long |
| 20 // press gesture at |location| in |view| coordinate space. |element| is an HTML | 20 // press gesture at |location| in |view| coordinate space. |element| is an HTML |
| 21 // element which received the gesture. | 21 // element which received the gesture. |
| 22 - (void)webView:(CWVWebView*)webView | 22 - (void)webView:(CWVWebView*)webView |
| 23 runContextMenuWithTitle:(NSString*)menuTitle | 23 runContextMenuWithTitle:(NSString*)menuTitle |
| 24 forHTMLElement:(CWVHTMLElement*)element | 24 forHTMLElement:(CWVHTMLElement*)element |
| 25 inView:(UIView*)view | 25 inView:(UIView*)view |
| 26 userGestureLocation:(CGPoint)location; | 26 userGestureLocation:(CGPoint)location; |
| 27 | 27 |
| 28 // Instructs the delegate to show UI in response to window.alert JavaScript |
| 29 // call. |
| 30 - (void)webView:(CWVWebView*)webView |
| 31 runJavaScriptAlertPanelWithMessage:(NSString*)message |
| 32 pageURL:(NSURL*)URL |
| 33 completionHandler:(void (^)(void))completionHandler; |
| 34 |
| 35 // Instructs the delegate to show UI in response to window.confirm JavaScript |
| 36 // call. |
| 37 - (void)webView:(CWVWebView*)webView |
| 38 runJavaScriptConfirmPanelWithMessage:(NSString*)message |
| 39 pageURL:(NSURL*)URL |
| 40 completionHandler:(void (^)(BOOL))completionHandler; |
| 41 |
| 42 // Instructs the delegate to show UI in response to window.prompt JavaScript |
| 43 // call. |
| 44 - (void)webView:(CWVWebView*)webView |
| 45 runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt |
| 46 defaultText:(NSString*)defaultText |
| 47 pageURL:(NSURL*)URL |
| 48 completionHandler: |
| 49 (void (^)(NSString*))completionHandler; |
| 50 |
| 28 @end | 51 @end |
| 29 | 52 |
| 30 #endif // IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_ | 53 #endif // IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_ |
| OLD | NEW |