| 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 89a97125d4cafc497a3c0d0e287448223d33865a..ace2ed358814243b2152cbc3a2ada5a809bb5484 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller.mm
|
| @@ -1793,6 +1793,11 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| const GURL currentURL([self currentURL]);
|
| [self didStartLoadingURL:currentURL updateHistory:loadSuccess];
|
| _loadPhase = web::PAGE_LOADED;
|
| + if (loadSuccess) {
|
| + _webStateImpl->OnNavigationCommitted(currentURL);
|
| + } else {
|
| + _webStateImpl->OnErrorPageNavigation(currentURL);
|
| + }
|
|
|
| // Perform post-load-finished updates.
|
| [self didFinishWithURL:currentURL loadSuccess:loadSuccess];
|
| @@ -4043,6 +4048,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| }
|
|
|
| - (void)didUpdateHistoryStateWithPageURL:(const GURL&)url {
|
| + _webStateImpl->OnSamePageNavigation(url);
|
| [_delegate webDidUpdateHistoryStateWithPageURL:url];
|
| }
|
|
|
| @@ -4901,7 +4907,14 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| // A fast back/forward within the same origin does not call
|
| // |didCommitNavigation:|, so signal page change explicitly.
|
| DCHECK_EQ(_documentURL.GetOrigin(), webViewURL.GetOrigin());
|
| + BOOL isSameDocumentNavigation =
|
| + [self isKVOChangePotentialSameDocumentNavigationToURL:webViewURL];
|
| [self setDocumentURL:webViewURL];
|
| + if (isSameDocumentNavigation) {
|
| + _webStateImpl->OnSamePageNavigation(webViewURL);
|
| + } else {
|
| + _webStateImpl->OnNavigationCommitted(webViewURL);
|
| + }
|
| [self webPageChanged];
|
| }
|
|
|
| @@ -5008,7 +5021,6 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| }
|
|
|
| - (BOOL)isKVOChangePotentialSameDocumentNavigationToURL:(const GURL&)newURL {
|
| - DCHECK([_webView isLoading]);
|
| // If the origin changes, it can't be same-document.
|
| if (_documentURL.GetOrigin().is_empty() ||
|
| _documentURL.GetOrigin() != newURL.GetOrigin()) {
|
| @@ -5056,6 +5068,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
|
|
| if (!_changingHistoryState) {
|
| [self didStartLoadingURL:_documentURL updateHistory:YES];
|
| + _webStateImpl->OnSamePageNavigation(newURL);
|
| [self updateSSLStatusForCurrentNavigationItem];
|
| [self didFinishNavigation];
|
| }
|
|
|