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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2378393002: Pass the user_gesture context in the IPC message FrameMsg_CommitNavigation to the renderer. (Closed)
Patch Set: Fix compile failures Created 4 years, 3 months 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 0483c3d0781c3c8393f1c3d29009769c38df48bd..eb07990fddd05079fc50cbde5df0d53990be22b1 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4868,6 +4868,12 @@ void RenderFrameImpl::OnCommitNavigation(
stream_override->stream_url = stream_url;
stream_override->response = response;
+ // If the request was initiated in the context of a user gesture then make
+ // sure that the navigation also executes in the context of a user gesture.
+ std::unique_ptr<blink::WebScopedUserGesture> gesture(
+ request_params.has_user_gesture ? new blink::WebScopedUserGesture
+ : nullptr);
+
NavigateInternal(common_params, StartNavigationParams(), request_params,
std::move(stream_override));
}
@@ -5523,7 +5529,7 @@ void RenderFrameImpl::NavigateInternal(
bool has_history_navigation_in_frame = false;
#if defined(OS_ANDROID)
- request.setHasUserGesture(start_params.has_user_gesture);
+ request.setHasUserGesture(request_params.has_user_gesture);
#endif
// PlzNavigate: Make sure that Blink's loader will not try to use browser side
« content/browser/frame_host/navigation_request.cc ('K') | « content/common/navigation_params.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698