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_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 <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #include "ios/web/public/web_view_type.h" | 10 #include "ios/web/public/web_view_type.h" |
|
Eugene But (OOO till 7-30)
2016/03/14 20:25:46
Is this include still necessary?
shreyasv1
2016/03/14 22:28:32
Done.
| |
| 11 | 11 |
| 12 @protocol CRWSimpleWebViewController; | 12 @protocol CRWSimpleWebViewController; |
| 13 @class WKWebView; | 13 @class WKWebView; |
| 14 @class WKWebViewConfiguration; | 14 @class WKWebViewConfiguration; |
| 15 | 15 |
| 16 // This file is a collection of functions that vend web views. | 16 // This file is a collection of functions that vend web views. |
| 17 namespace web { | 17 namespace web { |
| 18 class BrowserState; | 18 class BrowserState; |
| 19 | 19 |
| 20 // Returns a new UIWebView for displaying regular web content and registers a | 20 // Returns a new UIWebView for displaying regular web content and registers a |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 | 56 |
| 57 // Returns the total number of WKWebViews that are currently present. | 57 // Returns the total number of WKWebViews that are currently present. |
| 58 // NOTE: This only works in Debug builds and should not be used in Release | 58 // NOTE: This only works in Debug builds and should not be used in Release |
| 59 // builds. | 59 // builds. |
| 60 // DEPRECATED. Please use web::WebViewCounter instead. | 60 // DEPRECATED. Please use web::WebViewCounter instead. |
| 61 // TODO(shreyasv): Remove this once all callers have stopped using it. | 61 // TODO(shreyasv): Remove this once all callers have stopped using it. |
| 62 // crbug.com/480507 | 62 // crbug.com/480507 |
| 63 NSUInteger GetActiveWKWebViewsCount(); | 63 NSUInteger GetActiveWKWebViewsCount(); |
| 64 | 64 |
| 65 // Returns a CRWSimpleWebViewController for managing/showing a web view. | 65 // Returns a CRWSimpleWebViewController for managing/showing a web view. |
| 66 // The BrowsingDataPartition must be synchronized before this method is called. | |
| 67 // Note: Callers are responsible for releasing the CRWSimpleWebViewController. | 66 // Note: Callers are responsible for releasing the CRWSimpleWebViewController. |
| 68 // DEPRECATED: The usage of |WebViewType| param is deprecated. | |
| 69 // TODO(crbug.com/579697): By default the controller is backed by a WKWebView. | |
| 70 // Remove the |WebViewType| param once all clients have stopped using it. | |
| 71 id<CRWSimpleWebViewController> CreateSimpleWebViewController( | 67 id<CRWSimpleWebViewController> CreateSimpleWebViewController( |
| 72 CGRect frame, | 68 CGRect frame, |
| 73 BrowserState* browser_state, | 69 BrowserState* browser_state); |
| 74 WebViewType web_view_type = WK_WEB_VIEW_TYPE); | |
| 75 | |
| 76 // Returns a new CRWSimpleWebViewController subclass displaying static HTML file | |
| 77 // content stored in the application bundle. | |
| 78 // The BrowsingDataPartition must be synchronized before this method is called. | |
| 79 // Note: Callers are responsible for releasing the returned ViewController. | |
| 80 // TODO(crbug.com/579697): By default the controller is backed by a WKWebView. | |
| 81 // Remove the |WebViewType| param once all clients have stopped using it. | |
| 82 id<CRWSimpleWebViewController> CreateStaticFileSimpleWebViewController( | |
| 83 CGRect frame, | |
| 84 BrowserState* browser_state, | |
| 85 WebViewType web_view_type = WK_WEB_VIEW_TYPE); | |
| 86 | |
| 87 // Returns a new UIWebView subclass for displaying static HTML file content | |
| 88 // stored in the application bundle. if |browser_state| is nullptr, requests | |
| 89 // from the returned UIWebView will be done with global request context. When | |
| 90 // requests are made with global request context, requests such as file:// | |
| 91 // will fail. | |
| 92 // Note: Callers are responsible for releasing the returned UIWebView. | |
| 93 // DEPRECATED: Please use the |CreateStaticFileSimpleWebViewController| | |
| 94 // equivalent instead. | |
| 95 UIWebView* CreateStaticFileWebView(CGRect frame, BrowserState* browser_state); | |
| 96 | |
| 97 // A convenience method that returns a static file web view with | |
| 98 // CGRectZero and |nullptr| browser state. | |
| 99 // Note: Callers are responsible for releasing the returned UIWebView. | |
| 100 // DEPRECATED: Please use the |CreateStaticFileSimpleWebViewController| | |
| 101 // equivalent instead. | |
| 102 UIWebView* CreateStaticFileWebView(); | |
| 103 | 70 |
| 104 #if !defined(NDEBUG) | 71 #if !defined(NDEBUG) |
| 105 // Returns true if the creation of web views using alloc, init has been allowed | 72 // Returns true if the creation of web views using alloc, init has been allowed |
| 106 // by the embedder. | 73 // by the embedder. |
| 107 bool IsWebViewAllocInitAllowed(); | 74 bool IsWebViewAllocInitAllowed(); |
| 108 #endif | 75 #endif |
| 109 | 76 |
| 110 } // namespace web | 77 } // namespace web |
| 111 | 78 |
| 112 #endif // IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ | 79 #endif // IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ |
| OLD | NEW |