| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NAVIGATION_HANDLE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual bool IsParentMainFrame() = 0; | 63 virtual bool IsParentMainFrame() = 0; |
| 64 | 64 |
| 65 // Whether the navigation was initated by the renderer process. Examples of | 65 // Whether the navigation was initated by the renderer process. Examples of |
| 66 // renderer-initiated navigations include: | 66 // renderer-initiated navigations include: |
| 67 // * <a> link click | 67 // * <a> link click |
| 68 // * changing window.location.href | 68 // * changing window.location.href |
| 69 // * redirect via the <meta http-equiv="refresh"> tag | 69 // * redirect via the <meta http-equiv="refresh"> tag |
| 70 // * using window.history.pushState | 70 // * using window.history.pushState |
| 71 virtual bool IsRendererInitiated() = 0; | 71 virtual bool IsRendererInitiated() = 0; |
| 72 | 72 |
| 73 // Whether the navigation is synchronous or not. Examples of synchronous | |
| 74 // navigations are: | |
| 75 // * reference fragment navigations | |
| 76 // * pushState/popState | |
| 77 virtual bool IsSynchronousNavigation() = 0; | |
| 78 | |
| 79 // Whether the navigation is for an iframe with srcdoc attribute. | 73 // Whether the navigation is for an iframe with srcdoc attribute. |
| 80 virtual bool IsSrcdoc() = 0; | 74 virtual bool IsSrcdoc() = 0; |
| 81 | 75 |
| 82 // Returns the FrameTreeNode ID for the frame in which the navigation is | 76 // Returns the FrameTreeNode ID for the frame in which the navigation is |
| 83 // performed. This ID is browser-global and uniquely identifies a frame that | 77 // performed. This ID is browser-global and uniquely identifies a frame that |
| 84 // hosts content. The identifier is fixed at the creation of the frame and | 78 // hosts content. The identifier is fixed at the creation of the frame and |
| 85 // stays constant for the lifetime of the frame. | 79 // stays constant for the lifetime of the frame. |
| 86 virtual int GetFrameTreeNodeId() = 0; | 80 virtual int GetFrameTreeNodeId() = 0; |
| 87 | 81 |
| 88 // Returns the FrameTreeNode ID for the parent frame. If this navigation is | 82 // Returns the FrameTreeNode ID for the parent frame. If this navigation is |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 133 |
| 140 // Returns the RenderFrameHost this navigation is taking place in. This can | 134 // Returns the RenderFrameHost this navigation is taking place in. This can |
| 141 // only be accessed after a response has been delivered for processing. | 135 // only be accessed after a response has been delivered for processing. |
| 142 // | 136 // |
| 143 // If PlzNavigate is active, the RenderFrameHost returned will be the final | 137 // If PlzNavigate is active, the RenderFrameHost returned will be the final |
| 144 // host for the navigation. If PlzNavigate is inactive, the navigation may | 138 // host for the navigation. If PlzNavigate is inactive, the navigation may |
| 145 // transfer to a new host up until the point that DidFinishNavigation is | 139 // transfer to a new host up until the point that DidFinishNavigation is |
| 146 // called. | 140 // called. |
| 147 virtual RenderFrameHost* GetRenderFrameHost() = 0; | 141 virtual RenderFrameHost* GetRenderFrameHost() = 0; |
| 148 | 142 |
| 149 // Whether the navigation happened in the same page. This is only known | 143 // Whether the navigation happened in the same page. Examples of same page |
| 150 // after the navigation has committed. It is an error to call this method | 144 // navigations are: |
| 151 // before the navigation has committed. | 145 // * reference fragment navigations |
| 146 // * pushState/replaceState |
| 152 virtual bool IsSamePage() = 0; | 147 virtual bool IsSamePage() = 0; |
| 153 | 148 |
| 154 // Whether the navigation has encountered a server redirect or not. | 149 // Whether the navigation has encountered a server redirect or not. |
| 155 virtual bool WasServerRedirect() = 0; | 150 virtual bool WasServerRedirect() = 0; |
| 156 | 151 |
| 157 // Whether the navigation has committed. This returns true for either | 152 // Whether the navigation has committed. This returns true for either |
| 158 // successful commits or error pages that replace the previous page | 153 // successful commits or error pages that replace the previous page |
| 159 // (distinguished by |IsErrorPage|), and false for errors that leave the user | 154 // (distinguished by |IsErrorPage|), and false for errors that leave the user |
| 160 // on the previous page. | 155 // on the previous page. |
| 161 virtual bool HasCommitted() = 0; | 156 virtual bool HasCommitted() = 0; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 222 |
| 228 // The NavigationData that the embedder returned from | 223 // The NavigationData that the embedder returned from |
| 229 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will | 224 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will |
| 230 // be a clone of the NavigationData. | 225 // be a clone of the NavigationData. |
| 231 virtual NavigationData* GetNavigationData() = 0; | 226 virtual NavigationData* GetNavigationData() = 0; |
| 232 }; | 227 }; |
| 233 | 228 |
| 234 } // namespace content | 229 } // namespace content |
| 235 | 230 |
| 236 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 231 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
| OLD | NEW |