Chromium Code Reviews| 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..ebc8b2e180e60dee9e9e28341855c50ca2a038e7 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 |
| + // NavigationHandle::IsErrorPage. |
|
rohitrao (ping after 24h)
2017/02/24 01:22:48
What is "NavigationHandle"? I don't see any other
Eugene But (OOO till 7-30)
2017/02/24 01:49:41
Good catch. Done.
|
| + // |
| + // If this is called because the navigation committed, then the document load |
| + // will still be ongoing in the WebState returned by |navigation_handle|. |
|
rohitrao (ping after 24h)
2017/02/24 01:22:48
And here.
Eugene But (OOO till 7-30)
2017/02/24 01:49:41
Done.
|
| + // Use the document loads events such as DidStopLoading |
| + // and related methods to listen for continued events from this |
| + // WebState. |
| + // |
| + // Note that this is 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 NavigationHandle::IsSamePage. |
|
rohitrao (ping after 24h)
2017/02/24 01:22:48
And here.
Eugene But (OOO till 7-30)
2017/02/24 01:49:41
Done.
|
| + // |
| + // Note that |navigation_handle| 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. |