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

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

Issue 2639073002: Convert OverscrollNavigationOverlayTest.ImmediateLoadOnNavigate to use the new navigation callbacks… (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host, 374 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host,
375 common_params_.url); 375 common_params_.url);
376 376
377 // Inform the NavigationHandle that the navigation will commit. 377 // Inform the NavigationHandle that the navigation will commit.
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 // TODO(nasko): Update the NavigationHandle creation to ensure that the 385 // TODO(nasko): Update the NavigationHandle creation to ensure that the
385 // proper values are specified for is_same_page. 386 // proper values are specified for is_same_page.
386 navigation_handle_ = NavigationHandleImpl::Create( 387 FrameTreeNode* frame_tree_node = frame_tree_node_;
387 common_params_.url, frame_tree_node_, !browser_initiated_, 388 std::unique_ptr<NavigationHandleImpl> navigation_handle =
388 false, // is_same_page 389 NavigationHandleImpl::Create(
389 common_params_.navigation_start, pending_nav_entry_id, 390 common_params_.url, frame_tree_node_, !browser_initiated_,
390 false); // started_in_context_menu 391 false, // is_same_page
392 common_params_.navigation_start, pending_nav_entry_id,
393 false); // started_in_context_menu
394
395 if (!frame_tree_node->navigation_request()) {
396 // A callback could have cancelled this request synchronously in which case
397 // |this| is deleted.
398 return;
399 }
400
401 navigation_handle_ = std::move(navigation_handle);
391 402
392 if (!begin_params_.searchable_form_url.is_empty()) { 403 if (!begin_params_.searchable_form_url.is_empty()) {
393 navigation_handle_->set_searchable_form_url( 404 navigation_handle_->set_searchable_form_url(
394 begin_params_.searchable_form_url); 405 begin_params_.searchable_form_url);
395 navigation_handle_->set_searchable_form_encoding( 406 navigation_handle_->set_searchable_form_encoding(
396 begin_params_.searchable_form_encoding); 407 begin_params_.searchable_form_encoding);
397 } 408 }
398 } 409 }
399 410
400 void NavigationRequest::TransferNavigationHandleOwnership( 411 void NavigationRequest::TransferNavigationHandleOwnership(
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 724 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
714 725
715 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 726 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
716 common_params_, request_params_, 727 common_params_, request_params_,
717 is_view_source_); 728 is_view_source_);
718 729
719 frame_tree_node_->ResetNavigationRequest(true); 730 frame_tree_node_->ResetNavigationRequest(true);
720 } 731 }
721 732
722 } // namespace content 733 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698