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

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

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: 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/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 523a42fb78f2a0642f8e2eb5d1b6b234ae6aa259..15e5b44b758215c2e72d61da0c027b9209e9eff6 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1068,14 +1068,15 @@ void RenderFrameHostImpl::OnDocumentOnLoadCompleted(
void RenderFrameHostImpl::OnDidStartProvisionalLoad(
const GURL& url,
- const base::TimeTicks& navigation_start) {
+ const base::TimeTicks& navigation_start,
+ bool has_user_gesture) {
// TODO(clamy): Check if other navigation methods (OpenURL,
// DidFailProvisionalLoad, ...) should also be ignored if the RFH is no longer
// active.
if (!is_active())
return;
- frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url,
- navigation_start);
+ frame_tree_node_->navigator()->DidStartProvisionalLoad(
+ this, url, navigation_start, has_user_gesture);
}
void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
@@ -3223,7 +3224,8 @@ RenderFrameHostImpl::TakeNavigationHandleForCommit(
return NavigationHandleImpl::Create(
params.url, frame_tree_node_, is_renderer_initiated,
params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(),
- pending_nav_entry_id, false); // started_from_context_menu
+ pending_nav_entry_id, params.gesture == NavigationGestureUser,
clamy 2016/11/17 14:30:04 While we're at it, why not replace the has_user_ge
Bryan McQuade 2016/11/19 20:21:38 Sure, makes sense, thanks! I went ahead and did th
+ false); // started_from_context_menu
}
// Determine if the current NavigationHandle can be used.
@@ -3275,7 +3277,8 @@ RenderFrameHostImpl::TakeNavigationHandleForCommit(
return NavigationHandleImpl::Create(
params.url, frame_tree_node_, is_renderer_initiated,
params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(),
- entry_id_for_data_nav, false); // started_from_context_menu
+ entry_id_for_data_nav, params.gesture == NavigationGestureUser,
+ false); // started_from_context_menu
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698