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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.h ('k') | ios/web/web_state/ui/crw_web_controller_container_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index a072370364a004fa25513f56f7d74ce3e0f4e0c4..0a1ef8e6760fd07c676a15ee65c53274cce1edf8 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -662,6 +662,10 @@ NSError* WKWebViewErrorWithSource(NSError* error, WKWebViewErrorSource source) {
- (void)loadCompleteWithSuccess:(BOOL)loadSuccess;
// Called after URL is finished loading and _loadPhase is set to PAGE_LOADED.
- (void)didFinishWithURL:(const GURL&)currentURL loadSuccess:(BOOL)loadSuccess;
+// Loads a new URL if the current entry is not from a pushState() navigation.
+// |fromEntry| is the CRWSessionEntry that was the current entry prior to the
+// navigation.
+- (void)finishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry;
// Informs the native controller if web usage is allowed or not.
- (void)setNativeControllerWebUsageEnabled:(BOOL)webUsageEnabled;
// Called when web controller receives a new message from the web page.
@@ -1135,6 +1139,8 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
DCHECK([NSThread isMainThread]);
DCHECK(_isBeingDestroyed); // 'close' must have been called already.
DCHECK(!_webView);
+ // TODO(crbug.com/662860): Don't set the delegate to nil.
+ [_containerView setDelegate:nil];
_touchTrackingRecognizer.get().touchTrackingDelegate = nil;
[[_webViewProxy scrollViewProxy] removeObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -5397,13 +5403,16 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
GURL webViewURL = net::GURLWithNSURL([_webView URL]);
// For failed navigations, WKWebView will sometimes revert to the previous URL
- // before resettings its |isLoading| property to NO. If this is the first
- // navigation for the web view, this will result in an empty URL.
- if (webViewURL.is_empty() || webViewURL == _documentURL)
+ // before committing the current navigation or resetting the web view's
+ // |isLoading| property to NO. If this is the first navigation for the web
+ // view, this will result in an empty URL.
+ BOOL navigationWasCommitted = _loadPhase != web::LOAD_REQUESTED;
+ if (!navigationWasCommitted &&
+ (webViewURL.is_empty() || webViewURL == _documentURL)) {
return;
+ }
- if (_loadPhase == web::LOAD_REQUESTED &&
- ![_pendingNavigationInfo cancelled]) {
+ if (!navigationWasCommitted && ![_pendingNavigationInfo cancelled]) {
// A fast back/forward within the same origin does not call
// |didCommitNavigation:|, so signal page change explicitly.
DCHECK_EQ(_documentURL.GetOrigin(), webViewURL.GetOrigin());
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.h ('k') | ios/web/web_state/ui/crw_web_controller_container_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698