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

Unified Diff: ios/web/public/web_state/web_state_observer.h

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/public/web_state/ui/crw_web_delegate.h ('k') | ios/web/test/test_url_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/web_state/web_state_observer.h
diff --git a/ios/web/public/web_state/web_state_observer.h b/ios/web/public/web_state/web_state_observer.h
index 6fb99f3540d0186c3bc8c172febc1fb887351271..62114a0a7ec21bd035970e1139b953551786f86d 100644
--- a/ios/web/public/web_state/web_state_observer.h
+++ b/ios/web/public/web_state/web_state_observer.h
@@ -18,6 +18,7 @@ namespace web {
struct Credential;
struct FaviconURL;
+class NavigationContext;
struct LoadCommittedDetails;
class WebState;
class TestWebState;
@@ -48,6 +49,25 @@ class WebStateObserver {
virtual void NavigationItemCommitted(
const LoadCommittedDetails& load_details) {}
+ // Called when a navigation finished in the WebState. This happens when a
+ // navigation is committed, aborted or replaced by a new one. To know if the
+ // navigation has resulted in an error page, use
+ // NavigationContext::IsErrorPage().
+ //
+ // If this is called because the navigation committed, then the document load
+ // will still be ongoing in the WebState returned by |navigation_context|.
+ // Use the document loads events such as DidStopLoading
+ // and related methods to listen for continued events from this
+ // WebState.
+ //
+ // This is also fired by same-page navigations, such as fragment navigations
+ // or pushState/replaceState, which will not result in a document change. To
+ // filter these out, use NavigationContext::IsSamePage().
+ //
+ // |navigation_context| will be destroyed at the end of this call, so do not
+ // keep a reference to it afterward.
+ virtual void DidFinishNavigation(NavigationContext* navigation_context) {}
+
// Called when the current page has started loading.
virtual void DidStartLoading() {}
@@ -61,9 +81,11 @@ class WebStateObserver {
virtual void InterstitialDismissed() {}
// Called on URL hash change events.
+ // TODO(crbug.com/692331): Remove this method and use |DidFinishNavigation|.
virtual void UrlHashChanged() {}
// Called on history state change events.
+ // TODO(crbug.com/692331): Remove this method and use |DidFinishNavigation|.
virtual void HistoryStateChanged() {}
// Notifies the observer that the page has made some progress loading.
« no previous file with comments | « ios/web/public/web_state/ui/crw_web_delegate.h ('k') | ios/web/test/test_url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698