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

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

Issue 2698413004: Implemented WebStateObserver::DidFinishNavigation(NavigationHandle*). (Closed)
Patch Set: Addressed review comments Created 3 years, 10 months 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/navigation_context_impl_unittest.mm ('k') | ios/web/web_state/web_state_impl.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 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];
}
« no previous file with comments | « ios/web/web_state/navigation_context_impl_unittest.mm ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698