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

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

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: address comments Created 4 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
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 71063d8c46ba485a3eb2756f9ecb588f9f908940..ba85056c89b04b33c3622bd81fcec7746c58415a 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -143,7 +143,8 @@ NavigationController* NavigatorImpl::GetController() {
void NavigatorImpl::DidStartProvisionalLoad(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
- const base::TimeTicks& navigation_start) {
+ const base::TimeTicks& navigation_start,
+ NavigationGesture gesture) {
bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame();
bool is_error_page = (url.spec() == kUnreachableWebDataURL);
bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL);
@@ -209,7 +210,8 @@ void NavigatorImpl::DidStartProvisionalLoad(
is_renderer_initiated,
false, // is_same_page
is_iframe_srcdoc, // is_srcdoc
- navigation_start, pending_nav_entry_id, started_from_context_menu));
+ navigation_start, pending_nav_entry_id, gesture,
+ started_from_context_menu));
}
void NavigatorImpl::DidFailProvisionalLoadWithError(
@@ -967,8 +969,9 @@ void NavigatorImpl::OnBeginNavigation(
// request is not user-initiated.
if (ongoing_navigation_request &&
(ongoing_navigation_request->browser_initiated() ||
- ongoing_navigation_request->begin_params().has_user_gesture) &&
- !begin_params.has_user_gesture) {
+ ongoing_navigation_request->common_params().gesture ==
+ NavigationGestureUser) &&
+ common_params.gesture != NavigationGestureUser) {
RenderFrameHost* current_frame_host =
frame_tree_node->render_manager()->current_frame_host();
current_frame_host->Send(

Powered by Google App Engine
This is Rietveld 408576698