Chromium Code Reviews| 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 9be54a339178bdd4e335334a41159a6f5b187d8e..8cbc40e8952971c8ade069cb480edc49fbf37f8b 100644 |
| --- a/ios/web/web_state/ui/crw_web_controller.mm |
| +++ b/ios/web/web_state/ui/crw_web_controller.mm |
| @@ -1785,6 +1785,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]; |
| @@ -4026,6 +4031,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5; |
| } |
| - (void)didUpdateHistoryStateWithPageURL:(const GURL&)url { |
| + _webStateImpl->OnSamePageNavigation(url); |
| [_delegate webDidUpdateHistoryStateWithPageURL:url]; |
| } |
| @@ -4893,7 +4899,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 isSameDocumentNavigaiton = |
|
rohitrao (ping after 24h)
2017/02/24 01:22:48
Typo: navigation
Eugene But (OOO till 7-30)
2017/02/24 01:49:41
Done.
|
| + [self isKVOChangePotentialSameDocumentNavigationToURL:webViewURL]; |
| [self setDocumentURL:webViewURL]; |
| + if (isSameDocumentNavigaiton) { |
| + _webStateImpl->OnSamePageNavigation(webViewURL); |
| + } else { |
| + _webStateImpl->OnNavigationCommitted(webViewURL); |
| + } |
| [self webPageChanged]; |
| } |
| @@ -5000,7 +5013,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()) { |
| @@ -5048,6 +5060,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5; |
| if (!_changingHistoryState) { |
| [self didStartLoadingURL:_documentURL updateHistory:YES]; |
| + _webStateImpl->OnSamePageNavigation(newURL); |
| [self updateSSLStatusForCurrentNavigationItem]; |
| [self didFinishNavigation]; |
| } |