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 #include "content/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 // done here either. | 1794 // done here either. |
1795 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) | 1795 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) |
1796 frame_tree_node_->DidStartLoading(true); | 1796 frame_tree_node_->DidStartLoading(true); |
1797 } | 1797 } |
1798 | 1798 |
1799 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { | 1799 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { |
1800 DCHECK(data_url.SchemeIs(url::kDataScheme)); | 1800 DCHECK(data_url.SchemeIs(url::kDataScheme)); |
1801 CommonNavigationParams common_params( | 1801 CommonNavigationParams common_params( |
1802 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, | 1802 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, |
1803 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(), | 1803 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(), |
1804 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), | 1804 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF, |
1805 LOFI_OFF); | 1805 base::TimeTicks::Now()); |
1806 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1806 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1807 switches::kEnableBrowserSideNavigation)) { | 1807 switches::kEnableBrowserSideNavigation)) { |
1808 CommitNavigation(nullptr, nullptr, common_params, | 1808 CommitNavigation(nullptr, nullptr, common_params, |
1809 RequestNavigationParams()); | 1809 RequestNavigationParams()); |
1810 } else { | 1810 } else { |
1811 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); | 1811 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); |
1812 } | 1812 } |
1813 } | 1813 } |
1814 | 1814 |
1815 void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params, | 1815 void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params, |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2177 "RenderFrameHostImpl navigation suspended", this); | 2177 "RenderFrameHostImpl navigation suspended", this); |
2178 } | 2178 } |
2179 | 2179 |
2180 if (!suspend && suspended_nav_params_) { | 2180 if (!suspend && suspended_nav_params_) { |
2181 // There's navigation message params waiting to be sent. Now that we're not | 2181 // There's navigation message params waiting to be sent. Now that we're not |
2182 // suspended anymore, resume navigation by sending them. If we were swapped | 2182 // suspended anymore, resume navigation by sending them. If we were swapped |
2183 // out, we should also stop filtering out the IPC messages now. | 2183 // out, we should also stop filtering out the IPC messages now. |
2184 SetState(RenderFrameHostImpl::STATE_DEFAULT); | 2184 SetState(RenderFrameHostImpl::STATE_DEFAULT); |
2185 | 2185 |
2186 DCHECK(!proceed_time.is_null()); | 2186 DCHECK(!proceed_time.is_null()); |
2187 suspended_nav_params_->request_params.browser_navigation_start = | 2187 // TODO(csharrison): Make sure that PlzNavigate and the current architecture |
2188 proceed_time; | 2188 // measure navigation start in the same way in the presence of the |
| 2189 // BeforeUnload event. |
| 2190 suspended_nav_params_->common_params.navigation_start = proceed_time; |
2189 SendNavigateMessage(suspended_nav_params_->common_params, | 2191 SendNavigateMessage(suspended_nav_params_->common_params, |
2190 suspended_nav_params_->start_params, | 2192 suspended_nav_params_->start_params, |
2191 suspended_nav_params_->request_params); | 2193 suspended_nav_params_->request_params); |
2192 suspended_nav_params_.reset(); | 2194 suspended_nav_params_.reset(); |
2193 } | 2195 } |
2194 } | 2196 } |
2195 | 2197 |
2196 void RenderFrameHostImpl::CancelSuspendedNavigations() { | 2198 void RenderFrameHostImpl::CancelSuspendedNavigations() { |
2197 // Clear any state if a pending navigation is canceled or preempted. | 2199 // Clear any state if a pending navigation is canceled or preempted. |
2198 if (suspended_nav_params_) | 2200 if (suspended_nav_params_) |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2338 *dst = src; | 2340 *dst = src; |
2339 | 2341 |
2340 if (src.routing_id != -1) | 2342 if (src.routing_id != -1) |
2341 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2343 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
2342 | 2344 |
2343 if (src.parent_routing_id != -1) | 2345 if (src.parent_routing_id != -1) |
2344 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2346 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
2345 } | 2347 } |
2346 | 2348 |
2347 } // namespace content | 2349 } // namespace content |
OLD | NEW |