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 | |
189 // over pushed URLs. Needed so that sites that depend on URL params/fragment | |
190 // continue to work correctly and checks for the URL don't incorrectly trigger | |
191 // -pageChanged calls. | |
192 - (void)finishPushStateNavigationToURL:(const GURL&)url | |
193 withStateObject:(NSString*)stateObject; | |
194 // Loads the HTML into the page. | 188 // Loads the HTML into the page. |
195 - (void)loadHTML:(NSString*)html; | 189 - (void)loadHTML:(NSString*)html; |
196 // Loads HTML in the page and presents it as if it was originating from an | 190 // Loads HTML in the page and presents it as if it was originating from an |
197 // application specific URL. | 191 // application specific URL. |
198 - (void)loadHTML:(NSString*)HTML forAppSpecificURL:(const GURL&)URL; | 192 - (void)loadHTML:(NSString*)HTML forAppSpecificURL:(const GURL&)URL; |
199 | 193 |
200 // Causes the page to start loading immediately if there is a pending load; | 194 // 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 | 195 // 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 | 196 // 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 | 197 // bypass the lazy behavior. This is equivalent to calling -view, but should be |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // native controller. | 293 // native controller. |
300 - (void)loadErrorInNativeView:(NSError*)error; | 294 - (void)loadErrorInNativeView:(NSError*)error; |
301 | 295 |
302 // Resets the state of a page where a load was rejected. This method must | 296 // Resets the state of a page where a load was rejected. This method must |
303 // be called if an embedder rejected the page load (e.g. by returning NO from | 297 // be called if an embedder rejected the page load (e.g. by returning NO from |
304 // |-[WebDelegate shouldOpenURL:linkClicked:]|) but wants to continue working | 298 // |-[WebDelegate shouldOpenURL:linkClicked:]|) but wants to continue working |
305 // with CRWWebController. | 299 // with CRWWebController. |
306 - (void)restoreStateAfterURLRejection; | 300 - (void)restoreStateAfterURLRejection; |
307 | 301 |
308 // Helper method called at the end of history navigation methods goBack, | 302 // Helper method called at the end of history navigation methods goBack, |
309 // goForward, and goDelta. Determines whether to load a new URL or call | 303 // goForward, and goDelta. Loads a new URL if the current entry is not from a |
310 // |finishPushStateNavigationToURL:withStateObject:|. |fromEntry| is the | 304 // pushState() navigation from |fromEntry|. |fromEntry| is the |
311 // CRWSessionEntry that was the current entry prior to the navigation. | 305 // CRWSessionEntry that was the current entry prior to the navigation. |
312 // TODO(rohitrao): This is only exposed so Tab can call it temporarily. Remove | 306 // TODO(rohitrao): This is only exposed so Tab can call it temporarily. Remove |
313 // as soon as all the Tab calls have moved into CRWWebController. | 307 // as soon as all the Tab calls have moved into CRWWebController. |
314 - (void)finishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; | 308 - (void)finishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry; |
315 | 309 |
316 // Returns the native controller (if any) current mananging the content. | 310 // Returns the native controller (if any) current mananging the content. |
317 - (id<CRWNativeContent>)nativeController; | 311 - (id<CRWNativeContent>)nativeController; |
318 @end | 312 @end |
319 | 313 |
320 #pragma mark Testing | 314 #pragma mark Testing |
(...skipping 15 matching lines...) Expand all Loading... |
336 // Returns the header height. | 330 // Returns the header height. |
337 - (CGFloat)headerHeight; | 331 - (CGFloat)headerHeight; |
338 | 332 |
339 // Caches request POST data in the given session entry. Exposed for testing. | 333 // Caches request POST data in the given session entry. Exposed for testing. |
340 - (void)cachePOSTDataForRequest:(NSURLRequest*)request | 334 - (void)cachePOSTDataForRequest:(NSURLRequest*)request |
341 inSessionEntry:(CRWSessionEntry*)currentSessionEntry; | 335 inSessionEntry:(CRWSessionEntry*)currentSessionEntry; |
342 | 336 |
343 @end | 337 @end |
344 | 338 |
345 #endif // IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_H_ | 339 #endif // IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_H_ |
OLD | NEW |