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

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: Rebase onto TOT. 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
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator.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 (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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 // Register for redirect notifications sourced from |this|. 368 // Register for redirect notifications sourced from |this|.
369 notification_registrar_.Add( 369 notification_registrar_.Add(
370 this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, 370 this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
371 content::Source<WebContents>(GetWebContents())); 371 content::Source<WebContents>(GetWebContents()));
372 372
373 // Transfer over the user agent override. 373 // Transfer over the user agent override.
374 new_contents->SetUserAgentOverride( 374 new_contents->SetUserAgentOverride(
375 prerender_manager_->config().user_agent_override); 375 prerender_manager_->config().user_agent_override);
376 376
377 new_contents->GetController().LoadURLWithUserAgentOverride( 377 content::NavigationController::LoadURLParams load_url_params(
378 prerender_url_, 378 prerender_url_);
379 referrer_, 379 load_url_params.referrer = referrer_;
380 (origin_ == ORIGIN_OMNIBOX ? content::PAGE_TRANSITION_TYPED : 380 load_url_params.transition_type = (origin_ == ORIGIN_OMNIBOX ?
381 content::PAGE_TRANSITION_LINK), 381 content::PAGE_TRANSITION_TYPED : content::PAGE_TRANSITION_LINK);
382 false, 382 load_url_params.override_user_agent =
383 std::string(), 383 prerender_manager_->config().is_overriding_user_agent ?
384 prerender_manager_->config().is_overriding_user_agent); 384 content::NavigationController::UA_OVERRIDE_TRUE :
385 content::NavigationController::UA_OVERRIDE_FALSE;
386 new_contents->GetController().LoadURLWithParams(load_url_params);
385 } 387 }
386 388
387 bool PrerenderContents::GetChildId(int* child_id) const { 389 bool PrerenderContents::GetChildId(int* child_id) const {
388 CHECK(child_id); 390 CHECK(child_id);
389 DCHECK_GE(child_id_, -1); 391 DCHECK_GE(child_id_, -1);
390 *child_id = child_id_; 392 *child_id = child_id_;
391 return child_id_ != -1; 393 return child_id_ != -1;
392 } 394 }
393 395
394 bool PrerenderContents::GetRouteId(int* route_id) const { 396 bool PrerenderContents::GetRouteId(int* route_id) const {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 bool PrerenderContents::IsCrossSiteNavigationPending() const { 717 bool PrerenderContents::IsCrossSiteNavigationPending() const {
716 if (!prerender_contents_.get() || !prerender_contents_->web_contents()) 718 if (!prerender_contents_.get() || !prerender_contents_->web_contents())
717 return false; 719 return false;
718 const WebContents* web_contents = prerender_contents_->web_contents(); 720 const WebContents* web_contents = prerender_contents_->web_contents();
719 return (web_contents->GetSiteInstance() != 721 return (web_contents->GetSiteInstance() !=
720 web_contents->GetPendingSiteInstance()); 722 web_contents->GetPendingSiteInstance());
721 } 723 }
722 724
723 725
724 } // namespace prerender 726 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698