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

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

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: remove gesture dcheck 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/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 4c24485495582a9779114f52df872e9a33ff8b8c..102632e574c6d8b7221dafc4007cdab7cba35a36 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -159,7 +159,7 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
frame_entry, request_body, dest_url, dest_referrer,
navigation_type, lofi_state, navigation_start),
BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL,
- false, // has_user_gestures
+ NavigationGestureAuto,
false, // skip_service_worker
REQUEST_CONTEXT_TYPE_LOCATION),
entry.ConstructRequestNavigationParams(
@@ -189,21 +189,21 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated(
// renderer and sent to the browser instead of being measured here.
// TODO(clamy): The pending history list offset should be properly set.
RequestNavigationParams request_params(
- false, // is_overriding_user_agent
- std::vector<GURL>(), // redirects
- false, // can_load_local_resources
- PageState(), // page_state
- 0, // nav_entry_id
- false, // is_same_document_history_load
- false, // is_history_navigation_in_new_child
- std::map<std::string, bool>(), // subframe_unique_names
+ false, // is_overriding_user_agent
+ std::vector<GURL>(), // redirects
+ false, // can_load_local_resources
+ PageState(), // page_state
+ 0, // nav_entry_id
+ false, // is_same_document_history_load
+ false, // is_history_navigation_in_new_child
+ std::map<std::string, bool>(), // subframe_unique_names
frame_tree_node->has_committed_real_load(),
- false, // intended_as_new_entry
- -1, // pending_history_list_offset
+ false, // intended_as_new_entry
+ -1, // pending_history_list_offset
current_history_list_offset, current_history_list_length,
- false, // is_view_source
- false, // should_clear_history_list
- begin_params.has_user_gesture);
+ false, // is_view_source
+ false, // should_clear_history_list
+ begin_params.gesture);
std::unique_ptr<NavigationRequest> navigation_request(
new NavigationRequest(frame_tree_node, common_params, begin_params,
request_params, false, nullptr, nullptr));
@@ -279,8 +279,7 @@ void NavigationRequest::BeginNavigation() {
common_params_.method, common_params_.post_data,
Referrer::SanitizeForRequest(common_params_.url,
common_params_.referrer),
- begin_params_.has_user_gesture, common_params_.transition, false,
- begin_params_.request_context_type,
+ common_params_.transition, false, begin_params_.request_context_type,
base::Bind(&NavigationRequest::OnStartChecksComplete,
base::Unretained(this)));
return;
@@ -310,6 +309,7 @@ void NavigationRequest::CreateNavigationHandle(int pending_nav_entry_id) {
false, // is_same_page
false, // is_srcdoc
common_params_.navigation_start, pending_nav_entry_id,
+ begin_params_.gesture,
false); // started_in_context_menu
if (!begin_params_.searchable_form_url.is_empty()) {
@@ -598,7 +598,7 @@ void NavigationRequest::CommitNavigation() {
TransferNavigationHandleOwnership(render_frame_host);
- DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
+ DCHECK_EQ(request_params_.gesture, begin_params_.gesture);
render_frame_host->CommitNavigation(response_.get(), std::move(body_),
common_params_, request_params_,

Powered by Google App Engine
This is Rietveld 408576698