OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_CONTROLLER_H_ | |
6 #define IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_CONTROLLER_H_ | |
7 | |
8 #import <Foundation/Foundation.h> | |
9 #import <Webkit/Webkit.h> | |
10 | |
11 #import "ios/web/public/block_types.h" | |
12 | |
13 @protocol CRWContextMenuDelegate; | |
14 @protocol CRWJSInjectionEvaluator; | |
15 | |
16 // A controller that will recognise context menu gesture on |webView|. This | |
17 // controller will rely on a long press gesture recognizer and JavaScript to | |
18 // determine the element on which context menu is triggered. | |
19 // The trigger delay is slightly shorter that ths system's one. | |
20 @interface CRWContextMenuController : NSObject | |
21 | |
22 // Install the |CRWContextMenuController| on |webView|. | |
Eugene But (OOO till 7-30)
2017/01/13 18:23:42
s/Install/Installs
Olivier
2017/01/13 18:49:55
Done.
| |
23 // - |webView| cannot be nil. | |
Eugene But (OOO till 7-30)
2017/01/13 18:23:42
Please document that |webView| is not retained and
Olivier
2017/01/13 18:49:55
Done.
| |
24 // - |javaScriptDelegate| can proxy all javascript calls to |webView| to | |
25 // sanitize the eveluated strings. If |javaScriptDelegate| is nil, JavaScript | |
26 // is directly called on |webView|. | |
Eugene But (OOO till 7-30)
2017/01/13 18:23:42
nit: s/called/executed
Olivier
2017/01/13 18:49:55
Done.
| |
27 // - This class relies on the pre-injection of base.js in webView. | |
28 // - This class will perform gesture recognition and JavaScript on every touch | |
29 // event on |webView| and can have performance impact. | |
30 // TODO(crbug.com/228179): This class only triggers context menu on mainFrame. | |
31 - (instancetype)initWithWebView:(WKWebView*)webView | |
32 javaScriptDelegate: | |
Eugene But (OOO till 7-30)
2017/01/13 18:23:42
s/javaScriptDelegate/injectionEvaluator
Olivier
2017/01/13 18:49:55
Done.
| |
33 (id<CRWJSInjectionEvaluator>)javaScriptDelegate | |
Eugene But (OOO till 7-30)
2017/01/13 18:23:42
ditto
Olivier
2017/01/13 18:49:55
Done.
| |
34 delegate:(id<CRWContextMenuDelegate>)delegate | |
35 NS_DESIGNATED_INITIALIZER; | |
36 | |
37 - (instancetype)init NS_UNAVAILABLE; | |
38 | |
39 @end | |
40 | |
41 #endif // IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_CONTROLLER_H_ | |
OLD | NEW |