| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // navigation is committed, aborted or replaced by a new one. To know if the | 53 // navigation is committed, aborted or replaced by a new one. To know if the |
| 54 // navigation has resulted in an error page, use | 54 // navigation has resulted in an error page, use |
| 55 // NavigationContext::IsErrorPage(). | 55 // NavigationContext::IsErrorPage(). |
| 56 // | 56 // |
| 57 // If this is called because the navigation committed, then the document load | 57 // If this is called because the navigation committed, then the document load |
| 58 // will still be ongoing in the WebState returned by |navigation_context|. | 58 // will still be ongoing in the WebState returned by |navigation_context|. |
| 59 // Use the document loads events such as DidStopLoading | 59 // Use the document loads events such as DidStopLoading |
| 60 // and related methods to listen for continued events from this | 60 // and related methods to listen for continued events from this |
| 61 // WebState. | 61 // WebState. |
| 62 // | 62 // |
| 63 // This is also fired by same-page navigations, such as fragment navigations | 63 // This is also fired by same-document navigations, such as fragment |
| 64 // or pushState/replaceState, which will not result in a document change. To | 64 // navigations or pushState/replaceState, which will not result in a document |
| 65 // filter these out, use NavigationContext::IsSamePage(). | 65 // change. To filter these out, use NavigationContext::IsSameDocument(). |
| 66 // | 66 // |
| 67 // |navigation_context| will be destroyed at the end of this call, so do not | 67 // |navigation_context| will be destroyed at the end of this call, so do not |
| 68 // keep a reference to it afterward. | 68 // keep a reference to it afterward. |
| 69 virtual void DidFinishNavigation(NavigationContext* navigation_context) {} | 69 virtual void DidFinishNavigation(NavigationContext* navigation_context) {} |
| 70 | 70 |
| 71 // Called when the current page has started loading. | 71 // Called when the current page has started loading. |
| 72 virtual void DidStartLoading() {} | 72 virtual void DidStartLoading() {} |
| 73 | 73 |
| 74 // Called when the current page has stopped loading. | 74 // Called when the current page has stopped loading. |
| 75 virtual void DidStopLoading() {} | 75 virtual void DidStopLoading() {} |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 void ResetWebState(); | 183 void ResetWebState(); |
| 184 | 184 |
| 185 WebState* web_state_; | 185 WebState* web_state_; |
| 186 | 186 |
| 187 DISALLOW_COPY_AND_ASSIGN(WebStateObserver); | 187 DISALLOW_COPY_AND_ASSIGN(WebStateObserver); |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 } // namespace web | 190 } // namespace web |
| 191 | 191 |
| 192 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_H_ | 192 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_H_ |
| OLD | NEW |