| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // NavigationHandle. | 149 // NavigationHandle. |
| 150 // | 150 // |
| 151 // Note that there is no guarantee that DidFinishNavigation will be called | 151 // Note that there is no guarantee that DidFinishNavigation will be called |
| 152 // for any particular navigation before DidStartNavigation is called on the | 152 // for any particular navigation before DidStartNavigation is called on the |
| 153 // next. | 153 // next. |
| 154 virtual void DidStartNavigation(NavigationHandle* navigation_handle) {} | 154 virtual void DidStartNavigation(NavigationHandle* navigation_handle) {} |
| 155 | 155 |
| 156 // Called when a navigation encountered a server redirect. | 156 // Called when a navigation encountered a server redirect. |
| 157 virtual void DidRedirectNavigation(NavigationHandle* navigation_handle) {} | 157 virtual void DidRedirectNavigation(NavigationHandle* navigation_handle) {} |
| 158 | 158 |
| 159 // PlzNavigate |
| 159 // Called when the navigation is ready to be committed in a renderer. Most | 160 // Called when the navigation is ready to be committed in a renderer. Most |
| 160 // observers should use DidFinishNavigation instead, which happens right | 161 // observers should use DidFinishNavigation instead, which happens right |
| 161 // after the navigation commits. This method is for observers that want to | 162 // after the navigation commits. This method is for observers that want to |
| 162 // initialize renderer-side state just before the RenderFrame commits the | 163 // initialize renderer-side state just before the RenderFrame commits the |
| 163 // navigation. | 164 // navigation. |
| 164 // | 165 // |
| 165 // PlzNavigate | |
| 166 // This is the first point in time where a RenderFrameHost is associated with | 166 // This is the first point in time where a RenderFrameHost is associated with |
| 167 // the navigation. | 167 // the navigation. |
| 168 virtual void ReadyToCommitNavigation(NavigationHandle* navigation_handle) {} | 168 virtual void ReadyToCommitNavigation(NavigationHandle* navigation_handle) {} |
| 169 | 169 |
| 170 // Called when a navigation finished in the WebContents. This happens when a | 170 // Called when a navigation finished in the WebContents. This happens when a |
| 171 // navigation is committed, aborted or replaced by a new one. To know if the | 171 // navigation is committed, aborted or replaced by a new one. To know if the |
| 172 // navigation has committed, use NavigationHandle::HasCommitted; use | 172 // navigation has committed, use NavigationHandle::HasCommitted; use |
| 173 // NavigationHandle::IsErrorPage to know if the navigation resulted in an | 173 // NavigationHandle::IsErrorPage to know if the navigation resulted in an |
| 174 // error page. | 174 // error page. |
| 175 // | 175 // |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 void ResetWebContents(); | 514 void ResetWebContents(); |
| 515 | 515 |
| 516 WebContentsImpl* web_contents_; | 516 WebContentsImpl* web_contents_; |
| 517 | 517 |
| 518 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 518 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 519 }; | 519 }; |
| 520 | 520 |
| 521 } // namespace content | 521 } // namespace content |
| 522 | 522 |
| 523 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 523 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |