Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PUBLIC_WEB_VIEW_CREATION_UTIL_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_ |
| 6 #define IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_ | 6 #define IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_ |
| 7 | 7 |
| 8 #import <CoreGraphics/CoreGraphics.h> | 8 #import <CoreGraphics/CoreGraphics.h> |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 | 10 |
| 11 @protocol CRWContextMenuDelegate; | |
| 11 @class WKWebView; | 12 @class WKWebView; |
| 12 | 13 |
| 13 namespace web { | 14 namespace web { |
| 14 class BrowserState; | 15 class BrowserState; |
| 15 | 16 |
| 16 // Returns a new WKWebView for displaying regular web content. | 17 // Returns a new WKWebView for displaying regular web content. |
| 17 // WKWebViewConfiguration object for resulting web view will be obtained from | 18 // WKWebViewConfiguration object for resulting web view will be obtained from |
| 18 // the given |browser_state|. | 19 // the given |browser_state|. |
| 19 // | 20 // |
| 20 // Preconditions for creation of a WKWebView: | 21 // Preconditions for creation of a WKWebView: |
| 21 // 1) |browser_state| is not null. | 22 // 1) |browser_state| is not null. |
| 22 // 2) web::BrowsingDataPartition is synchronized. | 23 // 2) web::BrowsingDataPartition is synchronized. |
| 23 // | 24 // |
| 24 WKWebView* BuildWKWebView(CGRect frame, BrowserState* browser_state); | 25 WKWebView* BuildWKWebView(CGRect frame, BrowserState* browser_state); |
| 25 | 26 |
| 27 // Returns a new WKWebView for displaying regular web content. | |
| 28 // The returned WKWebView is equivalent to the one created by |BuildWKWebView| | |
| 29 // but a context menu recognizer is attached to it. | |
| 30 // On a long press, context_menu_delegate webView:handleContextMenu:| is called. | |
| 31 // Calling |BuildWKWebViewWithCustomContextMenu| with a |context_menu_delegate| | |
| 32 // nil is equivalent to |BuildWKWebView|. | |
|
Eugene But (OOO till 7-30)
2017/01/13 16:19:41
Attaching content menu recognized has an actual pe
Olivier
2017/01/13 18:08:58
Done.
| |
| 33 WKWebView* BuildWKWebViewWithCustomContextMenu( | |
| 34 CGRect frame, | |
| 35 BrowserState* browser_state, | |
| 36 id<CRWContextMenuDelegate> context_menu_delegate); | |
| 37 | |
| 26 } // web | 38 } // web |
| 27 | 39 |
| 28 #endif // IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_ | 40 #endif // IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_ |
| OLD | NEW |