| 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_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ | 5 #ifndef IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ |
| 6 #define IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ | 6 #define IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ |
| 7 | 7 |
| 8 #import <CoreGraphics/CoreGraphics.h> | 8 #import <CoreGraphics/CoreGraphics.h> |
| 9 #import <WebKit/WebKit.h> | 9 #import <WebKit/WebKit.h> |
| 10 | 10 |
| 11 @protocol CRWContextMenuDelegate; |
| 12 |
| 11 // This file is a collection of functions that vend web views. | 13 // This file is a collection of functions that vend web views. |
| 12 namespace web { | 14 namespace web { |
| 13 class BrowserState; | 15 class BrowserState; |
| 14 | 16 |
| 15 // Creates a new WKWebView for displaying regular web content and registers a | 17 // Creates a new WKWebView for displaying regular web content and registers a |
| 16 // user agent for it. | 18 // user agent for it. |
| 17 // | 19 // |
| 18 // Preconditions for creation of a WKWebView: | 20 // Preconditions for creation of a WKWebView: |
| 19 // 1) |browser_state|, |configuration| are not null. | 21 // 1) |browser_state|, |configuration| are not null. |
| 20 // 2) web::BrowsingDataPartition is synchronized. | 22 // 2) web::BrowsingDataPartition is synchronized. |
| 21 // 3) The WKProcessPool of the configuration is the same as the WKProcessPool | 23 // 3) The WKProcessPool of the configuration is the same as the WKProcessPool |
| 22 // of the WKWebViewConfiguration associated with |browser_state|. | 24 // of the WKWebViewConfiguration associated with |browser_state|. |
| 23 // | 25 // |
| 24 WKWebView* BuildWKWebView(CGRect frame, | 26 WKWebView* BuildWKWebView(CGRect frame, |
| 25 WKWebViewConfiguration* configuration, | 27 WKWebViewConfiguration* configuration, |
| 26 BrowserState* browser_state, | 28 BrowserState* browser_state, |
| 29 BOOL use_desktop_user_agent, |
| 30 id<CRWContextMenuDelegate> context_menu_delegate); |
| 31 |
| 32 // Creates and returns a new WKWebView for displaying regular web content. |
| 33 // The preconditions for the creation of a WKWebView are the same as the |
| 34 // previous method. |
| 35 WKWebView* BuildWKWebView(CGRect frame, |
| 36 WKWebViewConfiguration* configuration, |
| 37 BrowserState* browser_state, |
| 27 BOOL use_desktop_user_agent); | 38 BOOL use_desktop_user_agent); |
| 28 | 39 |
| 29 // Creates and returns a new WKWebView for displaying regular web content. | 40 // Creates and returns a new WKWebView for displaying regular web content. |
| 30 // The preconditions for the creation of a WKWebView are the same as the | 41 // The preconditions for the creation of a WKWebView are the same as the |
| 31 // previous method. | 42 // previous method. |
| 32 WKWebView* BuildWKWebView(CGRect frame, | 43 WKWebView* BuildWKWebView(CGRect frame, |
| 33 WKWebViewConfiguration* configuration, | 44 WKWebViewConfiguration* configuration, |
| 34 BrowserState* browser_state); | 45 BrowserState* browser_state); |
| 35 | 46 |
| 36 } // namespace web | 47 } // namespace web |
| 37 | 48 |
| 38 #endif // IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ | 49 #endif // IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ |
| OLD | NEW |