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

Side by Side Diff: content/browser/frame_host/navigation_request.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, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/navigation_request.h" 5 #include "content/browser/frame_host/navigation_request.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 -1, // page_id 169 -1, // page_id
170 0, // nav_entry_id 170 0, // nav_entry_id
171 false, // is_same_document_history_load 171 false, // is_same_document_history_load
172 false, // is_history_navigation_in_new_child 172 false, // is_history_navigation_in_new_child
173 false, // has_subtree_history_items 173 false, // has_subtree_history_items
174 frame_tree_node->has_committed_real_load(), 174 frame_tree_node->has_committed_real_load(),
175 false, // intended_as_new_entry 175 false, // intended_as_new_entry
176 -1, // pending_history_list_offset 176 -1, // pending_history_list_offset
177 current_history_list_offset, current_history_list_length, 177 current_history_list_offset, current_history_list_length,
178 false, // is_view_source 178 false, // is_view_source
179 false); // should_clear_history_list 179 false, // should_clear_history_list
180 begin_params.has_user_gesture);
180 std::unique_ptr<NavigationRequest> navigation_request( 181 std::unique_ptr<NavigationRequest> navigation_request(
181 new NavigationRequest(frame_tree_node, common_params, begin_params, 182 new NavigationRequest(frame_tree_node, common_params, begin_params,
182 request_params, false, nullptr, nullptr)); 183 request_params, false, nullptr, nullptr));
183 return navigation_request; 184 return navigation_request;
184 } 185 }
185 186
186 NavigationRequest::NavigationRequest( 187 NavigationRequest::NavigationRequest(
187 FrameTreeNode* frame_tree_node, 188 FrameTreeNode* frame_tree_node,
188 const CommonNavigationParams& common_params, 189 const CommonNavigationParams& common_params,
189 const BeginNavigationParams& begin_params, 190 const BeginNavigationParams& begin_params,
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 510
510 // Retrieve the RenderFrameHost that needs to commit the navigation. 511 // Retrieve the RenderFrameHost that needs to commit the navigation.
511 RenderFrameHostImpl* render_frame_host = 512 RenderFrameHostImpl* render_frame_host =
512 navigation_handle_->GetRenderFrameHost(); 513 navigation_handle_->GetRenderFrameHost();
513 DCHECK(render_frame_host == 514 DCHECK(render_frame_host ==
514 frame_tree_node_->render_manager()->current_frame_host() || 515 frame_tree_node_->render_manager()->current_frame_host() ||
515 render_frame_host == 516 render_frame_host ==
516 frame_tree_node_->render_manager()->speculative_frame_host()); 517 frame_tree_node_->render_manager()->speculative_frame_host());
517 518
518 TransferNavigationHandleOwnership(render_frame_host); 519 TransferNavigationHandleOwnership(render_frame_host);
520
521 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
nasko 2016/09/30 20:21:47 nit: I'd move this DCHECK at the beginning of the
522
519 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 523 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
520 common_params_, request_params_, 524 common_params_, request_params_,
521 is_view_source_); 525 is_view_source_);
522 526
523 frame_tree_node_->ResetNavigationRequest(true); 527 frame_tree_node_->ResetNavigationRequest(true);
524 } 528 }
525 529
526 } // namespace content 530 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698