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

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 2657323003: Convert HistoryTabHelper to use the new navigation callbacks. (Closed)
Patch Set: better fix to send this data from the renderer initially Created 3 years, 10 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 "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "content/browser/appcache/appcache_navigation_handle.h" 10 #include "content/browser/appcache/appcache_navigation_handle.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 navigation_handle_->ReadyToCommitNavigation(render_frame_host); 378 navigation_handle_->ReadyToCommitNavigation(render_frame_host);
379 379
380 CommitNavigation(); 380 CommitNavigation();
381 } 381 }
382 382
383 void NavigationRequest::CreateNavigationHandle(int pending_nav_entry_id) { 383 void NavigationRequest::CreateNavigationHandle(int pending_nav_entry_id) {
384 DCHECK_EQ(frame_tree_node_->navigation_request(), this); 384 DCHECK_EQ(frame_tree_node_->navigation_request(), this);
385 // TODO(nasko): Update the NavigationHandle creation to ensure that the 385 // TODO(nasko): Update the NavigationHandle creation to ensure that the
386 // proper values are specified for is_same_page. 386 // proper values are specified for is_same_page.
387 FrameTreeNode* frame_tree_node = frame_tree_node_; 387 FrameTreeNode* frame_tree_node = frame_tree_node_;
388
389 std::vector<GURL> redirect_chain;
390 if (!begin_params_.client_side_redirect_url.is_empty())
391 redirect_chain.push_back(begin_params_.client_side_redirect_url);
392 redirect_chain.push_back(common_params_.url);
393
388 std::unique_ptr<NavigationHandleImpl> navigation_handle = 394 std::unique_ptr<NavigationHandleImpl> navigation_handle =
389 NavigationHandleImpl::Create( 395 NavigationHandleImpl::Create(
390 common_params_.url, frame_tree_node_, !browser_initiated_, 396 common_params_.url, redirect_chain, frame_tree_node_,
397 !browser_initiated_,
391 false, // is_same_page 398 false, // is_same_page
392 common_params_.navigation_start, pending_nav_entry_id, 399 common_params_.navigation_start, pending_nav_entry_id,
393 false); // started_in_context_menu 400 false); // started_in_context_menu
394 401
395 if (!frame_tree_node->navigation_request()) { 402 if (!frame_tree_node->navigation_request()) {
396 // A callback could have cancelled this request synchronously in which case 403 // A callback could have cancelled this request synchronously in which case
397 // |this| is deleted. 404 // |this| is deleted.
398 return; 405 return;
399 } 406 }
400 407
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 731 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
725 732
726 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 733 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
727 common_params_, request_params_, 734 common_params_, request_params_,
728 is_view_source_); 735 is_view_source_);
729 736
730 frame_tree_node_->ResetNavigationRequest(true); 737 frame_tree_node_->ResetNavigationRequest(true);
731 } 738 }
732 739
733 } // namespace content 740 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698