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

Side by Side Diff: chrome/browser/prerender/prerender_contents.cc

Issue 10830144: Consolidate all NavigationController::LoadURL and family functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: NOTREACHED checks for post/data loads. Created 8 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/prerender/prerender_contents.h" 5 #include "chrome/browser/prerender/prerender_contents.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 // Register for redirect notifications sourced from |this|. 364 // Register for redirect notifications sourced from |this|.
365 notification_registrar_.Add( 365 notification_registrar_.Add(
366 this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, 366 this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
367 content::Source<WebContents>(GetWebContents())); 367 content::Source<WebContents>(GetWebContents()));
368 368
369 // Transfer over the user agent override. 369 // Transfer over the user agent override.
370 new_contents->SetUserAgentOverride( 370 new_contents->SetUserAgentOverride(
371 prerender_manager_->config().user_agent_override); 371 prerender_manager_->config().user_agent_override);
372 372
373 new_contents->GetController().LoadURLWithUserAgentOverride( 373 content::NavigationController::LoadURLParams load_url_params(
374 prerender_url_, 374 prerender_url_);
375 referrer_, 375 load_url_params.referrer = referrer_;
376 (origin_ == ORIGIN_OMNIBOX ? content::PAGE_TRANSITION_TYPED : 376 load_url_params.transition_type = (origin_ == ORIGIN_OMNIBOX ?
377 content::PAGE_TRANSITION_LINK), 377 content::PAGE_TRANSITION_TYPED : content::PAGE_TRANSITION_LINK);
378 false, 378 load_url_params.should_inherit_user_agent_override = false;
379 std::string(), 379 load_url_params.is_overriding_user_agent =
380 prerender_manager_->config().is_overriding_user_agent); 380 prerender_manager_->config().is_overriding_user_agent;
381 new_contents->GetController().LoadURLWithParams(load_url_params);
381 } 382 }
382 383
383 bool PrerenderContents::GetChildId(int* child_id) const { 384 bool PrerenderContents::GetChildId(int* child_id) const {
384 CHECK(child_id); 385 CHECK(child_id);
385 DCHECK_GE(child_id_, -1); 386 DCHECK_GE(child_id_, -1);
386 *child_id = child_id_; 387 *child_id = child_id_;
387 return child_id_ != -1; 388 return child_id_ != -1;
388 } 389 }
389 390
390 bool PrerenderContents::GetRouteId(int* route_id) const { 391 bool PrerenderContents::GetRouteId(int* route_id) const {
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 bool PrerenderContents::IsCrossSiteNavigationPending() const { 708 bool PrerenderContents::IsCrossSiteNavigationPending() const {
708 if (!prerender_contents_.get() || !prerender_contents_->web_contents()) 709 if (!prerender_contents_.get() || !prerender_contents_->web_contents())
709 return false; 710 return false;
710 const WebContents* web_contents = prerender_contents_->web_contents(); 711 const WebContents* web_contents = prerender_contents_->web_contents();
711 return (web_contents->GetSiteInstance() != 712 return (web_contents->GetSiteInstance() !=
712 web_contents->GetPendingSiteInstance()); 713 web_contents->GetPendingSiteInstance());
713 } 714 }
714 715
715 716
716 } // namespace prerender 717 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698