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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "content/browser/frame_host/navigation_controller_impl.h" | 13 #include "content/browser/frame_host/navigation_controller_impl.h" |
14 #include "content/browser/frame_host/navigator.h" | 14 #include "content/browser/frame_host/navigator.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/common/navigation_params.h" | 16 #include "content/common/navigation_params.h" |
17 #include "content/public/common/previews_state.h" | 17 #include "content/public/common/previews_state.h" |
18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
19 | 19 |
20 class GURL; | 20 class GURL; |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 class NavigationControllerImpl; | 24 class NavigationControllerImpl; |
25 class NavigatorDelegate; | 25 class NavigatorDelegate; |
26 class ResourceRequestBodyImpl; | 26 class ResourceRequestBody; |
27 struct LoadCommittedDetails; | 27 struct LoadCommittedDetails; |
28 | 28 |
29 // This class is an implementation of Navigator, responsible for managing | 29 // This class is an implementation of Navigator, responsible for managing |
30 // navigations in regular browser tabs. | 30 // navigations in regular browser tabs. |
31 class CONTENT_EXPORT NavigatorImpl : public Navigator { | 31 class CONTENT_EXPORT NavigatorImpl : public Navigator { |
32 public: | 32 public: |
33 NavigatorImpl(NavigationControllerImpl* navigation_controller, | 33 NavigatorImpl(NavigationControllerImpl* navigation_controller, |
34 NavigatorDelegate* delegate); | 34 NavigatorDelegate* delegate); |
35 | 35 |
36 static void CheckWebUIRendererDoesNotDisplayNormalURL( | 36 static void CheckWebUIRendererDoesNotDisplayNormalURL( |
(...skipping 24 matching lines...) Expand all Loading... |
61 bool NavigateToPendingEntry(FrameTreeNode* frame_tree_node, | 61 bool NavigateToPendingEntry(FrameTreeNode* frame_tree_node, |
62 const FrameNavigationEntry& frame_entry, | 62 const FrameNavigationEntry& frame_entry, |
63 ReloadType reload_type, | 63 ReloadType reload_type, |
64 bool is_same_document_history_load) override; | 64 bool is_same_document_history_load) override; |
65 bool NavigateNewChildFrame(RenderFrameHostImpl* render_frame_host, | 65 bool NavigateNewChildFrame(RenderFrameHostImpl* render_frame_host, |
66 const GURL& default_url) override; | 66 const GURL& default_url) override; |
67 void RequestOpenURL( | 67 void RequestOpenURL( |
68 RenderFrameHostImpl* render_frame_host, | 68 RenderFrameHostImpl* render_frame_host, |
69 const GURL& url, | 69 const GURL& url, |
70 bool uses_post, | 70 bool uses_post, |
71 const scoped_refptr<ResourceRequestBodyImpl>& body, | 71 const scoped_refptr<ResourceRequestBody>& body, |
72 const std::string& extra_headers, | 72 const std::string& extra_headers, |
73 const Referrer& referrer, | 73 const Referrer& referrer, |
74 WindowOpenDisposition disposition, | 74 WindowOpenDisposition disposition, |
75 bool force_new_process_for_new_contents, | 75 bool force_new_process_for_new_contents, |
76 bool should_replace_current_entry, | 76 bool should_replace_current_entry, |
77 bool user_gesture, | 77 bool user_gesture, |
78 blink::WebTriggeringEventInfo triggering_event_info) override; | 78 blink::WebTriggeringEventInfo triggering_event_info) override; |
79 void RequestTransferURL(RenderFrameHostImpl* render_frame_host, | 79 void RequestTransferURL(RenderFrameHostImpl* render_frame_host, |
80 const GURL& url, | 80 const GURL& url, |
81 SiteInstance* source_site_instance, | 81 SiteInstance* source_site_instance, |
82 const std::vector<GURL>& redirect_chain, | 82 const std::vector<GURL>& redirect_chain, |
83 const Referrer& referrer, | 83 const Referrer& referrer, |
84 ui::PageTransition page_transition, | 84 ui::PageTransition page_transition, |
85 const GlobalRequestID& transferred_global_request_id, | 85 const GlobalRequestID& transferred_global_request_id, |
86 bool should_replace_current_entry, | 86 bool should_replace_current_entry, |
87 const std::string& method, | 87 const std::string& method, |
88 scoped_refptr<ResourceRequestBodyImpl> post_body, | 88 scoped_refptr<ResourceRequestBody> post_body, |
89 const std::string& extra_headers) override; | 89 const std::string& extra_headers) override; |
90 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, | 90 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, |
91 bool proceed, | 91 bool proceed, |
92 const base::TimeTicks& proceed_time) override; | 92 const base::TimeTicks& proceed_time) override; |
93 void OnBeginNavigation(FrameTreeNode* frame_tree_node, | 93 void OnBeginNavigation(FrameTreeNode* frame_tree_node, |
94 const CommonNavigationParams& common_params, | 94 const CommonNavigationParams& common_params, |
95 const BeginNavigationParams& begin_params) override; | 95 const BeginNavigationParams& begin_params) override; |
96 void OnAbortNavigation(FrameTreeNode* frame_tree_node) override; | 96 void OnAbortNavigation(FrameTreeNode* frame_tree_node) override; |
97 void LogResourceRequestTime(base::TimeTicks timestamp, | 97 void LogResourceRequestTime(base::TimeTicks timestamp, |
98 const GURL& url) override; | 98 const GURL& url) override; |
(...skipping 14 matching lines...) Expand all Loading... |
113 // Navigates to the given entry, which might be the pending entry (if | 113 // Navigates to the given entry, which might be the pending entry (if |
114 // |is_pending_entry| is true). Private because all callers should use either | 114 // |is_pending_entry| is true). Private because all callers should use either |
115 // NavigateToPendingEntry or NavigateToNewChildFrame. | 115 // NavigateToPendingEntry or NavigateToNewChildFrame. |
116 bool NavigateToEntry(FrameTreeNode* frame_tree_node, | 116 bool NavigateToEntry(FrameTreeNode* frame_tree_node, |
117 const FrameNavigationEntry& frame_entry, | 117 const FrameNavigationEntry& frame_entry, |
118 const NavigationEntryImpl& entry, | 118 const NavigationEntryImpl& entry, |
119 ReloadType reload_type, | 119 ReloadType reload_type, |
120 bool is_same_document_history_load, | 120 bool is_same_document_history_load, |
121 bool is_history_navigation_in_new_child, | 121 bool is_history_navigation_in_new_child, |
122 bool is_pending_entry, | 122 bool is_pending_entry, |
123 const scoped_refptr<ResourceRequestBodyImpl>& post_body); | 123 const scoped_refptr<ResourceRequestBody>& post_body); |
124 | 124 |
125 bool ShouldAssignSiteForURL(const GURL& url); | 125 bool ShouldAssignSiteForURL(const GURL& url); |
126 | 126 |
127 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it | 127 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it |
128 // to execute the beforeUnload event. Otherwise, the navigation request will | 128 // to execute the beforeUnload event. Otherwise, the navigation request will |
129 // be started. | 129 // be started. |
130 void RequestNavigation( | 130 void RequestNavigation(FrameTreeNode* frame_tree_node, |
131 FrameTreeNode* frame_tree_node, | 131 const GURL& dest_url, |
132 const GURL& dest_url, | 132 const Referrer& dest_referrer, |
133 const Referrer& dest_referrer, | 133 const FrameNavigationEntry& frame_entry, |
134 const FrameNavigationEntry& frame_entry, | 134 const NavigationEntryImpl& entry, |
135 const NavigationEntryImpl& entry, | 135 ReloadType reload_type, |
136 ReloadType reload_type, | 136 PreviewsState previews_state, |
137 PreviewsState previews_state, | 137 bool is_same_document_history_load, |
138 bool is_same_document_history_load, | 138 bool is_history_navigation_in_new_child, |
139 bool is_history_navigation_in_new_child, | 139 const scoped_refptr<ResourceRequestBody>& post_body, |
140 const scoped_refptr<ResourceRequestBodyImpl>& post_body, | 140 base::TimeTicks navigation_start); |
141 base::TimeTicks navigation_start); | |
142 | 141 |
143 void RecordNavigationMetrics( | 142 void RecordNavigationMetrics( |
144 const LoadCommittedDetails& details, | 143 const LoadCommittedDetails& details, |
145 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 144 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
146 SiteInstance* site_instance); | 145 SiteInstance* site_instance); |
147 | 146 |
148 // Called when a navigation has started in a main frame, to update the pending | 147 // Called when a navigation has started in a main frame, to update the pending |
149 // NavigationEntry if the controller does not currently have a | 148 // NavigationEntry if the controller does not currently have a |
150 // browser-initiated one. | 149 // browser-initiated one. |
151 void DidStartMainFrameNavigation(const GURL& url, | 150 void DidStartMainFrameNavigation(const GURL& url, |
(...skipping 11 matching lines...) Expand all Loading... |
163 NavigatorDelegate* delegate_; | 162 NavigatorDelegate* delegate_; |
164 | 163 |
165 std::unique_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; | 164 std::unique_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; |
166 | 165 |
167 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 166 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
168 }; | 167 }; |
169 | 168 |
170 } // namespace content | 169 } // namespace content |
171 | 170 |
172 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 171 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
OLD | NEW |