Chromium Code Reviews| Index: ios/web/web_state/ui/crw_context_menu_controller.h |
| diff --git a/ios/web/web_state/ui/crw_context_menu_controller.h b/ios/web/web_state/ui/crw_context_menu_controller.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..17ecfcdbef6cdb7e94ea4a3e2446fb7dbbcbbacc |
| --- /dev/null |
| +++ b/ios/web/web_state/ui/crw_context_menu_controller.h |
| @@ -0,0 +1,41 @@ |
| +// 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_WEB_STATE_UI_CRW_CONTEXT_MENU_CONTROLLER_H_ |
| +#define IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_CONTROLLER_H_ |
| + |
| +#import <Foundation/Foundation.h> |
| +#import <Webkit/Webkit.h> |
| + |
| +#import "ios/web/public/block_types.h" |
| + |
| +@protocol CRWContextMenuDelegate; |
| +@protocol CRWJSInjectionEvaluator; |
| + |
| +// A controller that will recognise context menu gesture on |webView|. This |
| +// controller will rely on a long press gesture recognizer and JavaScript to |
| +// determine the element on which context menu is triggered. |
| +// The trigger delay is slightly shorter that ths system's one. |
| +@interface CRWContextMenuController : NSObject |
| + |
| +// 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.
|
| +// - |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.
|
| +// - |javaScriptDelegate| can proxy all javascript calls to |webView| to |
| +// sanitize the eveluated strings. If |javaScriptDelegate| is nil, JavaScript |
| +// 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.
|
| +// - This class relies on the pre-injection of base.js in webView. |
| +// - This class will perform gesture recognition and JavaScript on every touch |
| +// event on |webView| and can have performance impact. |
| +// TODO(crbug.com/228179): This class only triggers context menu on mainFrame. |
| +- (instancetype)initWithWebView:(WKWebView*)webView |
| + javaScriptDelegate: |
|
Eugene But (OOO till 7-30)
2017/01/13 18:23:42
s/javaScriptDelegate/injectionEvaluator
Olivier
2017/01/13 18:49:55
Done.
|
| + (id<CRWJSInjectionEvaluator>)javaScriptDelegate |
|
Eugene But (OOO till 7-30)
2017/01/13 18:23:42
ditto
Olivier
2017/01/13 18:49:55
Done.
|
| + delegate:(id<CRWContextMenuDelegate>)delegate |
| + NS_DESIGNATED_INITIALIZER; |
| + |
| +- (instancetype)init NS_UNAVAILABLE; |
| + |
| +@end |
| + |
| +#endif // IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_CONTROLLER_H_ |