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 "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
11 #include "ui/base/window_open_disposition.h" | 11 #include "ui/base/window_open_disposition.h" |
12 | 12 |
13 class GURL; | 13 class GURL; |
14 struct FrameHostMsg_BeginNavigation_Params; | 14 struct FrameHostMsg_BeginNavigation_Params; |
15 struct FrameHostMsg_DidCommitProvisionalLoad_Params; | 15 struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
16 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params; | 16 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params; |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class TimeTicks; | 19 class TimeTicks; |
20 } | 20 } |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
| 24 class FrameTreeNode; |
24 class NavigationControllerImpl; | 25 class NavigationControllerImpl; |
25 class NavigationEntryImpl; | 26 class NavigationEntryImpl; |
| 27 class NavigationRequest; |
26 class NavigatorDelegate; | 28 class NavigatorDelegate; |
27 class RenderFrameHostImpl; | 29 class RenderFrameHostImpl; |
28 struct CommitNavigationParams; | |
29 struct CommonNavigationParams; | 30 struct CommonNavigationParams; |
| 31 struct NavigationBeforeCommitInfo; |
30 | 32 |
31 // Implementations of this interface are responsible for performing navigations | 33 // Implementations of this interface are responsible for performing navigations |
32 // in a node of the FrameTree. Its lifetime is bound to all FrameTreeNode | 34 // in a node of the FrameTree. Its lifetime is bound to all FrameTreeNode |
33 // objects that are using it and will be released once all nodes that use it are | 35 // objects that are using it and will be released once all nodes that use it are |
34 // freed. The Navigator is bound to a single frame tree and cannot be used by | 36 // freed. The Navigator is bound to a single frame tree and cannot be used by |
35 // multiple instances of FrameTree. | 37 // multiple instances of FrameTree. |
36 // TODO(nasko): Move all navigation methods, such as didStartProvisionalLoad | 38 // TODO(nasko): Move all navigation methods, such as didStartProvisionalLoad |
37 // from WebContentsImpl to this interface. | 39 // from WebContentsImpl to this interface. |
38 class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> { | 40 class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> { |
39 public: | 41 public: |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 RenderFrameHostImpl* render_frame_host, | 105 RenderFrameHostImpl* render_frame_host, |
104 const GURL& url, | 106 const GURL& url, |
105 const std::vector<GURL>& redirect_chain, | 107 const std::vector<GURL>& redirect_chain, |
106 const Referrer& referrer, | 108 const Referrer& referrer, |
107 ui::PageTransition page_transition, | 109 ui::PageTransition page_transition, |
108 WindowOpenDisposition disposition, | 110 WindowOpenDisposition disposition, |
109 const GlobalRequestID& transferred_global_request_id, | 111 const GlobalRequestID& transferred_global_request_id, |
110 bool should_replace_current_entry, | 112 bool should_replace_current_entry, |
111 bool user_gesture) {} | 113 bool user_gesture) {} |
112 | 114 |
| 115 // PlzNavigate: Used to start a navigation. OnBeginNavigation is called |
| 116 // directly by RequestNavigation when there is no live renderer. Otherwise, it |
| 117 // is called following a BeginNavigation IPC from the renderer (which in |
| 118 // browser-initiated navigation also happens after RequestNavigation has been |
| 119 // called). |
| 120 virtual void OnBeginNavigation( |
| 121 FrameTreeNode* frame_tree_node, |
| 122 const FrameHostMsg_BeginNavigation_Params& params, |
| 123 const CommonNavigationParams& common_params) {} |
| 124 |
113 // PlzNavigate | 125 // PlzNavigate |
114 // Signal |render_frame_host| that a navigation is ready to commit (the | 126 // Signal |render_frame_host| that a navigation is ready to commit (the |
115 // response to the navigation request has been received). | 127 // response to the navigation request has been received). |
116 virtual void CommitNavigation(RenderFrameHostImpl* render_frame_host, | 128 virtual void CommitNavigation(FrameTreeNode* frame_tree_node, |
117 const GURL& stream_url, | 129 const NavigationBeforeCommitInfo& info) {} |
118 const CommonNavigationParams& common_params, | 130 |
119 const CommitNavigationParams& commit_params) {} | 131 // PlzNavigate |
| 132 // Cancel a NavigationRequest for |frame_tree_node|. Called when |
| 133 // |frame_tree_node| is destroyed. |
| 134 virtual void CancelNavigation(FrameTreeNode* frame_tree_node) {} |
120 | 135 |
121 protected: | 136 protected: |
122 friend class base::RefCounted<Navigator>; | 137 friend class base::RefCounted<Navigator>; |
123 virtual ~Navigator() {} | 138 virtual ~Navigator() {} |
124 }; | 139 }; |
125 | 140 |
126 } // namespace content | 141 } // namespace content |
127 | 142 |
128 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 143 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
OLD | NEW |