OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_UI_CRW_WEB_CONTROLLER_H_ | 5 #ifndef IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_H_ |
6 #define IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_H_ | 6 #define IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 // YES if the CRWWebController's view is deemed appropriate for saving in order | 178 // YES if the CRWWebController's view is deemed appropriate for saving in order |
179 // to generate an overlay placeholder view. | 179 // to generate an overlay placeholder view. |
180 - (BOOL)canUseViewForGeneratingOverlayPlaceholderView; | 180 - (BOOL)canUseViewForGeneratingOverlayPlaceholderView; |
181 | 181 |
182 // Start loading the URL specified in |originalParams|, with the specified | 182 // Start loading the URL specified in |originalParams|, with the specified |
183 // settings. Always resets the openedByScript property to NO. | 183 // settings. Always resets the openedByScript property to NO. |
184 - (void)loadWithParams:(const web::WebLoadParams&)originalParams; | 184 - (void)loadWithParams:(const web::WebLoadParams&)originalParams; |
185 | 185 |
186 // Loads the URL indicated by current session state. | 186 // Loads the URL indicated by current session state. |
187 - (void)loadCurrentURL; | 187 - (void)loadCurrentURL; |
188 // Updates UIWebView's URL and urlOnStartLoading_ during back/forward navigation | 188 // Injects JavaScript into the web view to update the URL to |url|, to set |
189 // over pushed URLs. Needed so that sites that depend on URL params/fragment | 189 // window.history.state to |stateObject|, and to trigger a popstate() event. |
190 // continue to work correctly and checks for the URL don't incorrectly trigger | 190 // Upon the scripts completion, resets |urlOnStartLoading_| and |
191 // -pageChanged calls. | 191 // |_lastRegisteredRequestURL| to |url|. This is necessary so that sites that |
192 - (void)finishPushStateNavigationToURL:(const GURL&)url | 192 // depend on URL params/fragments continue to work correctly and that checks for |
193 withStateObject:(NSString*)stateObject; | 193 // the URL don't incorrectly trigger |-pageChanged| calls. |
194 - (void)setPushedOrReplacedURL:(const GURL&)url | |
Eugene But (OOO till 7-30)
2015/09/18 02:02:35
Since this method is not called anywhere, lets tak
Eugene But (OOO till 7-30)
2015/09/18 02:02:36
NIT: s/url/URL (including changes in the comments)
kkhorimoto
2015/09/21 22:55:13
Done.
| |
195 stateObject:(NSString*)stateObject; | |
194 // Loads the HTML into the page. | 196 // Loads the HTML into the page. |
195 - (void)loadHTML:(NSString*)html; | 197 - (void)loadHTML:(NSString*)html; |
196 // Loads HTML in the page and presents it as if it was originating from an | 198 // Loads HTML in the page and presents it as if it was originating from an |
197 // application specific URL. | 199 // application specific URL. |
198 - (void)loadHTML:(NSString*)HTML forAppSpecificURL:(const GURL&)URL; | 200 - (void)loadHTML:(NSString*)HTML forAppSpecificURL:(const GURL&)URL; |
199 | 201 |
200 // Causes the page to start loading immediately if there is a pending load; | 202 // Causes the page to start loading immediately if there is a pending load; |
201 // normally if the web view has been paged out for memory reasons, loads are | 203 // normally if the web view has been paged out for memory reasons, loads are |
202 // started lazily the next time the view is displayed. This can be called to | 204 // started lazily the next time the view is displayed. This can be called to |
203 // bypass the lazy behavior. This is equivalent to calling -view, but should be | 205 // bypass the lazy behavior. This is equivalent to calling -view, but should be |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 - (void)loadErrorInNativeView:(NSError*)error; | 296 - (void)loadErrorInNativeView:(NSError*)error; |
295 | 297 |
296 // Resets the state of a page where a load was rejected. This method must | 298 // Resets the state of a page where a load was rejected. This method must |
297 // be called if an embedder rejected the page load (e.g. by returning NO from | 299 // be called if an embedder rejected the page load (e.g. by returning NO from |
298 // |-[WebDelegate shouldOpenURL:linkClicked:]|) but wants to continue working | 300 // |-[WebDelegate shouldOpenURL:linkClicked:]|) but wants to continue working |
299 // with CRWWebController. | 301 // with CRWWebController. |
300 - (void)restoreStateAfterURLRejection; | 302 - (void)restoreStateAfterURLRejection; |
301 | 303 |
302 // Helper method called at the end of history navigation methods goBack, | 304 // Helper method called at the end of history navigation methods goBack, |
303 // goForward, and goDelta. Determines whether to load a new URL or call | 305 // goForward, and goDelta. Determines whether to load a new URL or call |
304 // |finishPushStateNavigationToURL:withStateObject:|. |fromEntry| is the | 306 // |setPushedOrReplacedURL:stateObject:|. |fromEntry| is the |
Eugene But (OOO till 7-30)
2015/09/18 02:02:36
NIT: I think mentioning setPushedOrReplacedURL:sta
kkhorimoto
2015/09/21 22:55:13
Done.
| |
305 // CRWSessionEntry that was the current entry prior to the navigation. | 307 // CRWSessionEntry that was the current entry prior to the navigation. |
306 // TODO(rohitrao): This is only exposed so Tab can call it temporarily. Remove | 308 // TODO(rohitrao): This is only exposed so Tab can call it temporarily. Remove |
307 // as soon as all the Tab calls have moved into CRWWebController. | 309 // as soon as all the Tab calls have moved into CRWWebController. |
308 - (void)finishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; | 310 - (void)finishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; |
309 | 311 |
310 // Returns the native controller (if any) current mananging the content. | 312 // Returns the native controller (if any) current mananging the content. |
311 - (id<CRWNativeContent>)nativeController; | 313 - (id<CRWNativeContent>)nativeController; |
312 @end | 314 @end |
313 | 315 |
314 #pragma mark Testing | 316 #pragma mark Testing |
(...skipping 15 matching lines...) Expand all Loading... | |
330 // Returns the header height. | 332 // Returns the header height. |
331 - (CGFloat)headerHeight; | 333 - (CGFloat)headerHeight; |
332 | 334 |
333 // Caches request POST data in the given session entry. Exposed for testing. | 335 // Caches request POST data in the given session entry. Exposed for testing. |
334 - (void)cachePOSTDataForRequest:(NSURLRequest*)request | 336 - (void)cachePOSTDataForRequest:(NSURLRequest*)request |
335 inSessionEntry:(CRWSessionEntry*)currentSessionEntry; | 337 inSessionEntry:(CRWSessionEntry*)currentSessionEntry; |
336 | 338 |
337 @end | 339 @end |
338 | 340 |
339 #endif // IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_H_ | 341 #endif // IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_H_ |
OLD | NEW |