| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Called when a navigation started in the WebContents. |navigation_handle| | 133 // Called when a navigation started in the WebContents. |navigation_handle| |
| 134 // is unique to a specific navigation. The same |navigation_handle| will be | 134 // is unique to a specific navigation. The same |navigation_handle| will be |
| 135 // provided on subsequent calls to DidRedirectNavigation, DidFinishNavigation, | 135 // provided on subsequent calls to DidRedirectNavigation, DidFinishNavigation, |
| 136 // and ReadyToCommitNavigation when related to this navigation. Observers | 136 // and ReadyToCommitNavigation when related to this navigation. Observers |
| 137 // should clear any references to |navigation_handle| in DidFinishNavigation, | 137 // should clear any references to |navigation_handle| in DidFinishNavigation, |
| 138 // just before it is destroyed. | 138 // just before it is destroyed. |
| 139 // | 139 // |
| 140 // Note that this is fired by navigations in any frame of the WebContents, | 140 // Note that this is fired by navigations in any frame of the WebContents, |
| 141 // not just the main frame. | 141 // not just the main frame. |
| 142 // | 142 // |
| 143 // Note that this is fired by same-page navigations, such as fragment | 143 // Note that this is fired by same-document navigations, such as fragment |
| 144 // navigations or pushState/replaceState, which will not result in a document | 144 // navigations or pushState/replaceState, which will not result in a document |
| 145 // change. To filter these out, use NavigationHandle::IsSamePage. | 145 // change. To filter these out, use NavigationHandle::IsSameDocument. |
| 146 // | 146 // |
| 147 // Note that more than one navigation can be ongoing in the same frame at the | 147 // Note that more than one navigation can be ongoing in the same frame at the |
| 148 // same time (including the main frame). Each will get its own | 148 // same time (including the main frame). Each will get its own |
| 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 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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 // |
| 176 // If this is called because the navigation committed, then the document load | 176 // If this is called because the navigation committed, then the document load |
| 177 // will still be ongoing in the RenderFrameHost returned by | 177 // will still be ongoing in the RenderFrameHost returned by |
| 178 // |navigation_handle|. Use the document loads events such as DidStopLoading | 178 // |navigation_handle|. Use the document loads events such as DidStopLoading |
| 179 // and related methods to listen for continued events from this | 179 // and related methods to listen for continued events from this |
| 180 // RenderFrameHost. | 180 // RenderFrameHost. |
| 181 // | 181 // |
| 182 // Note that this is fired by same-page navigations, such as fragment | 182 // Note that this is fired by same-document navigations, such as fragment |
| 183 // navigations or pushState/replaceState, which will not result in a document | 183 // navigations or pushState/replaceState, which will not result in a document |
| 184 // change. To filter these out, use NavigationHandle::IsSamePage. | 184 // change. To filter these out, use NavigationHandle::IsSameDocument. |
| 185 // | 185 // |
| 186 // Note that |navigation_handle| will be destroyed at the end of this call, | 186 // Note that |navigation_handle| will be destroyed at the end of this call, |
| 187 // so do not keep a reference to it afterward. | 187 // so do not keep a reference to it afterward. |
| 188 virtual void DidFinishNavigation(NavigationHandle* navigation_handle) {} | 188 virtual void DidFinishNavigation(NavigationHandle* navigation_handle) {} |
| 189 | 189 |
| 190 // Navigation (obsolete and deprecated) -------------------------------------- | 190 // Navigation (obsolete and deprecated) -------------------------------------- |
| 191 | 191 |
| 192 // This method is invoked after the browser process starts a navigation to a | 192 // This method is invoked after the browser process starts a navigation to a |
| 193 // pending NavigationEntry. It is not called for renderer-initiated | 193 // pending NavigationEntry. It is not called for renderer-initiated |
| 194 // navigations unless they are sent to the browser process via OpenURL. It may | 194 // navigations unless they are sent to the browser process via OpenURL. It may |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 void ResetWebContents(); | 457 void ResetWebContents(); |
| 458 | 458 |
| 459 WebContentsImpl* web_contents_; | 459 WebContentsImpl* web_contents_; |
| 460 | 460 |
| 461 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 461 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 462 }; | 462 }; |
| 463 | 463 |
| 464 } // namespace content | 464 } // namespace content |
| 465 | 465 |
| 466 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 466 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |