| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 | 24 |
| 25 class FrameTreeNode; | 25 class FrameTreeNode; |
| 26 class NavigationControllerImpl; | 26 class NavigationControllerImpl; |
| 27 class NavigationEntryImpl; | 27 class NavigationEntryImpl; |
| 28 class NavigationRequest; | 28 class NavigationRequest; |
| 29 class NavigatorDelegate; | 29 class NavigatorDelegate; |
| 30 class RenderFrameHostImpl; | 30 class RenderFrameHostImpl; |
| 31 class ResourceRequestBody; |
| 31 class StreamHandle; | 32 class StreamHandle; |
| 33 struct BeginNavigationParams; |
| 32 struct CommonNavigationParams; | 34 struct CommonNavigationParams; |
| 33 struct ResourceResponse; | 35 struct ResourceResponse; |
| 34 | 36 |
| 35 // Implementations of this interface are responsible for performing navigations | 37 // Implementations of this interface are responsible for performing navigations |
| 36 // in a node of the FrameTree. Its lifetime is bound to all FrameTreeNode | 38 // in a node of the FrameTree. Its lifetime is bound to all FrameTreeNode |
| 37 // objects that are using it and will be released once all nodes that use it are | 39 // objects that are using it and will be released once all nodes that use it are |
| 38 // freed. The Navigator is bound to a single frame tree and cannot be used by | 40 // freed. The Navigator is bound to a single frame tree and cannot be used by |
| 39 // multiple instances of FrameTree. | 41 // multiple instances of FrameTree. |
| 40 // TODO(nasko): Move all navigation methods, such as didStartProvisionalLoad | 42 // TODO(nasko): Move all navigation methods, such as didStartProvisionalLoad |
| 41 // from WebContentsImpl to this interface. | 43 // from WebContentsImpl to this interface. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const GURL& url, | 111 const GURL& url, |
| 110 SiteInstance* source_site_instance, | 112 SiteInstance* source_site_instance, |
| 111 const std::vector<GURL>& redirect_chain, | 113 const std::vector<GURL>& redirect_chain, |
| 112 const Referrer& referrer, | 114 const Referrer& referrer, |
| 113 ui::PageTransition page_transition, | 115 ui::PageTransition page_transition, |
| 114 WindowOpenDisposition disposition, | 116 WindowOpenDisposition disposition, |
| 115 const GlobalRequestID& transferred_global_request_id, | 117 const GlobalRequestID& transferred_global_request_id, |
| 116 bool should_replace_current_entry, | 118 bool should_replace_current_entry, |
| 117 bool user_gesture) {} | 119 bool user_gesture) {} |
| 118 | 120 |
| 119 // PlzNavigate: Used to start a navigation. OnBeginNavigation is called | 121 // PlzNavigate |
| 120 // directly by RequestNavigation when there is no live renderer. Otherwise, it | 122 // Called after receiving a BeforeUnloadACK IPC from the renderer. If |
| 121 // is called following a BeginNavigation IPC from the renderer (which in | 123 // |frame_tree_node| has a NavigationRequest waiting for the renderer |
| 122 // browser-initiated navigation also happens after RequestNavigation has been | 124 // response, then the request is either started or canceled, depending on the |
| 123 // called). | 125 // value of |proceed|. |
| 126 virtual void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, |
| 127 bool proceed) {} |
| 128 |
| 129 // PlzNavigate |
| 130 // Used to start a new renderer-initiated navigation, following a |
| 131 // BeginNavigation IPC from the renderer. |
| 124 virtual void OnBeginNavigation( | 132 virtual void OnBeginNavigation( |
| 125 FrameTreeNode* frame_tree_node, | 133 FrameTreeNode* frame_tree_node, |
| 126 const FrameHostMsg_BeginNavigation_Params& params, | 134 const CommonNavigationParams& common_params, |
| 127 const CommonNavigationParams& common_params) {} | 135 const BeginNavigationParams& begin_params, |
| 136 scoped_refptr<ResourceRequestBody> body); |
| 128 | 137 |
| 129 // PlzNavigate | 138 // PlzNavigate |
| 130 // Signal |render_frame_host| that a navigation is ready to commit (the | 139 // Signal |render_frame_host| that a navigation is ready to commit (the |
| 131 // response to the navigation request has been received). | 140 // response to the navigation request has been received). |
| 132 virtual void CommitNavigation(FrameTreeNode* frame_tree_node, | 141 virtual void CommitNavigation(FrameTreeNode* frame_tree_node, |
| 133 ResourceResponse* response, | 142 ResourceResponse* response, |
| 134 scoped_ptr<StreamHandle> body); | 143 scoped_ptr<StreamHandle> body); |
| 135 | 144 |
| 136 // PlzNavigate | 145 // PlzNavigate |
| 137 // Cancel a NavigationRequest for |frame_tree_node|. Called when | 146 // Cancel a NavigationRequest for |frame_tree_node|. Called when |
| (...skipping 21 matching lines...) Expand all Loading... |
| 159 virtual bool IsWaitingForBeforeUnloadACK(FrameTreeNode* frame_tree_node); | 168 virtual bool IsWaitingForBeforeUnloadACK(FrameTreeNode* frame_tree_node); |
| 160 | 169 |
| 161 protected: | 170 protected: |
| 162 friend class base::RefCounted<Navigator>; | 171 friend class base::RefCounted<Navigator>; |
| 163 virtual ~Navigator() {} | 172 virtual ~Navigator() {} |
| 164 }; | 173 }; |
| 165 | 174 |
| 166 } // namespace content | 175 } // namespace content |
| 167 | 176 |
| 168 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 177 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
| OLD | NEW |