| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_H_ |
| 6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // More than one navigation can be ongoing in the same frame at the same | 61 // More than one navigation can be ongoing in the same frame at the same |
| 62 // time. Each will get its own NavigationHandle. | 62 // time. Each will get its own NavigationHandle. |
| 63 // | 63 // |
| 64 // There is no guarantee that DidFinishNavigation() will be called for any | 64 // There is no guarantee that DidFinishNavigation() will be called for any |
| 65 // particular navigation before DidStartNavigation is called on the next. | 65 // particular navigation before DidStartNavigation is called on the next. |
| 66 virtual void DidStartNavigation(NavigationContext* navigation_context) {} | 66 virtual void DidStartNavigation(NavigationContext* navigation_context) {} |
| 67 | 67 |
| 68 // Called when a navigation finished in the WebState for the main frame. This | 68 // Called when a navigation finished in the WebState for the main frame. This |
| 69 // happens when a navigation is committed, aborted or replaced by a new one. | 69 // happens when a navigation is committed, aborted or replaced by a new one. |
| 70 // To know if the navigation has resulted in an error page, use | 70 // To know if the navigation has resulted in an error page, use |
| 71 // NavigationContext::IsErrorPage(). | 71 // NavigationContext::GetError(). |
| 72 // | 72 // |
| 73 // If this is called because the navigation committed, then the document load | 73 // If this is called because the navigation committed, then the document load |
| 74 // will still be ongoing in the WebState returned by |navigation_context|. | 74 // will still be ongoing in the WebState returned by |navigation_context|. |
| 75 // Use the document loads events such as DidStopLoading | 75 // Use the document loads events such as DidStopLoading |
| 76 // and related methods to listen for continued events from this | 76 // and related methods to listen for continued events from this |
| 77 // WebState. | 77 // WebState. |
| 78 // | 78 // |
| 79 // This is also fired by same-document navigations, such as fragment | 79 // This is also fired by same-document navigations, such as fragment |
| 80 // navigations or pushState/replaceState, which will not result in a document | 80 // navigations or pushState/replaceState, which will not result in a document |
| 81 // change. To filter these out, use NavigationContext::IsSameDocument(). | 81 // change. To filter these out, use NavigationContext::IsSameDocument(). |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 void ResetWebState(); | 159 void ResetWebState(); |
| 160 | 160 |
| 161 WebState* web_state_; | 161 WebState* web_state_; |
| 162 | 162 |
| 163 DISALLOW_COPY_AND_ASSIGN(WebStateObserver); | 163 DISALLOW_COPY_AND_ASSIGN(WebStateObserver); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 } // namespace web | 166 } // namespace web |
| 167 | 167 |
| 168 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_H_ | 168 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_H_ |
| OLD | NEW |