Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: ios/web/web_state/web_view_internal_creation_util.h

Issue 1799843002: Removing StaticFileWebView vending methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GetBS() Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11
12 @protocol CRWSimpleWebViewController; 10 @protocol CRWSimpleWebViewController;
13 @class WKWebView; 11 @class WKWebView;
14 @class WKWebViewConfiguration; 12 @class WKWebViewConfiguration;
15 13
16 // This file is a collection of functions that vend web views. 14 // This file is a collection of functions that vend web views.
17 namespace web { 15 namespace web {
18 class BrowserState; 16 class BrowserState;
19 17
20 // Returns a new UIWebView for displaying regular web content and registers a 18 // Returns a new UIWebView for displaying regular web content and registers a
21 // user agent for it. The returned UIWebView will have a user agent string that 19 // user agent for it. The returned UIWebView will have a user agent string that
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 54
57 // Returns the total number of WKWebViews that are currently present. 55 // 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 56 // NOTE: This only works in Debug builds and should not be used in Release
59 // builds. 57 // builds.
60 // DEPRECATED. Please use web::WebViewCounter instead. 58 // DEPRECATED. Please use web::WebViewCounter instead.
61 // TODO(shreyasv): Remove this once all callers have stopped using it. 59 // TODO(shreyasv): Remove this once all callers have stopped using it.
62 // crbug.com/480507 60 // crbug.com/480507
63 NSUInteger GetActiveWKWebViewsCount(); 61 NSUInteger GetActiveWKWebViewsCount();
64 62
65 // Returns a CRWSimpleWebViewController for managing/showing a web view. 63 // 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. 64 // 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( 65 id<CRWSimpleWebViewController> CreateSimpleWebViewController(
72 CGRect frame, 66 CGRect frame,
73 BrowserState* browser_state, 67 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 68
104 #if !defined(NDEBUG) 69 #if !defined(NDEBUG)
105 // Returns true if the creation of web views using alloc, init has been allowed 70 // Returns true if the creation of web views using alloc, init has been allowed
106 // by the embedder. 71 // by the embedder.
107 bool IsWebViewAllocInitAllowed(); 72 bool IsWebViewAllocInitAllowed();
108 #endif 73 #endif
109 74
110 } // namespace web 75 } // namespace web
111 76
112 #endif // IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_ 77 #endif // IOS_WEB_WEB_STATE_WEB_VIEW_INTERNAL_CREATION_UTIL_H_
OLDNEW
« no previous file with comments | « ios/web/net/crw_url_verifying_protocol_handler.mm ('k') | ios/web/web_state/web_view_internal_creation_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698