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 // This file is a collection of functions that vend web views. | 11 // This file is a collection of functions that vend web views. |
12 namespace web { | 12 namespace web { |
13 class BrowserState; | 13 class BrowserState; |
14 | 14 |
15 // Creates a new WKWebView for displaying regular web content and registers a | 15 // Creates a new WKWebView for displaying regular web content and registers a |
16 // user agent for it. | 16 // user agent for it. |
17 // | 17 // |
18 // Preconditions for creation of a WKWebView: | 18 // Preconditions for creation of a WKWebView: |
19 // 1) |browser_state|, |configuration| are not null. | 19 // 1) |browser_state|, |configuration| are not null. |
20 // 2) web::BrowsingDataPartition is synchronized. | 20 // 2) web::BrowsingDataPartition is synchronized. |
21 // 3) The WKProcessPool of the configuration is the same as the WKProcessPool | 21 // 3) The WKProcessPool of the configuration is the same as the WKProcessPool |
22 // of the WKWebViewConfiguration associated with |browser_state|. | 22 // of the WKWebViewConfiguration associated with |browser_state|. |
23 // | 23 // |
24 // Note: Callers are responsible for releasing the returned WKWebView. | 24 // Note: Callers are responsible for releasing the returned WKWebView. |
25 WKWebView* CreateWKWebView(CGRect frame, | 25 WKWebView* CreateWKWebView(CGRect frame, |
26 WKWebViewConfiguration* configuration, | 26 WKWebViewConfiguration* configuration, |
27 BrowserState* browser_state, | 27 BrowserState* browser_state, |
28 BOOL use_desktop_user_agent); | 28 BOOL use_desktop_user_agent) NS_RETURNS_RETAINED; |
29 | 29 |
30 // Creates and returns a new WKWebView for displaying regular web content. | 30 // Creates and returns a new WKWebView for displaying regular web content. |
31 // The preconditions for the creation of a WKWebView are the same as the | 31 // The preconditions for the creation of a WKWebView are the same as the |
32 // previous method. | 32 // previous method. |
33 // Note: Callers are responsible for releasing the returned WKWebView. | 33 // Note: Callers are responsible for releasing the returned WKWebView. |
34 WKWebView* CreateWKWebView(CGRect frame, | 34 WKWebView* CreateWKWebView(CGRect frame, |
35 WKWebViewConfiguration* configuration, | 35 WKWebViewConfiguration* configuration, |
36 BrowserState* browser_state); | 36 BrowserState* browser_state) NS_RETURNS_RETAINED; |
37 | 37 |
38 } // namespace web | 38 } // namespace web |
39 | 39 |
40 #endif // IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ | 40 #endif // IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ |
OLD | NEW |