Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 1446253002: PlzNavigate: inform the WebFrameClient that a form will be submitted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 788c23d356b18b45d4df4d95cec5b5bfa4f5ae1a..410f62d2b70a1d0998a0424862defc31644f84ae 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -676,6 +676,8 @@ void NavigatorImpl::OnBeginNavigation(
(ongoing_navigation_request->browser_initiated() ||
ongoing_navigation_request->begin_params().has_user_gesture) &&
!begin_params.has_user_gesture) {
+ // Inform the renderer that its request will not be treated.
+ frame_tree_node->current_frame_host()->Stop();
return;
}
@@ -787,6 +789,14 @@ void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node,
void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) {
CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation));
+ NavigationRequest* navigation_request = frame_tree_node->navigation_request();
+
+ // If the navigation was renderer-initiated, the renderer expects the browser
+ // to be treating it. Inform the renderer that the navigation is no longer
+ // ongoing.
+ if (navigation_request && !navigation_request->browser_initiated())
+ frame_tree_node->current_frame_host()->Stop();
+
frame_tree_node->ResetNavigationRequest(false);
if (frame_tree_node->IsMainFrame())
navigation_data_.reset();
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698