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

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

Issue 8785004: Change NavigationController::LoadURL to take a Referrer class instead of a GURL as referrer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <utility> 8 #include <utility>
9 9
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 notification_registrar_.Add( 318 notification_registrar_.Add(
319 this, content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, 319 this, content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED,
320 content::Source<TabContents>(new_contents)); 320 content::Source<TabContents>(new_contents));
321 321
322 DCHECK(load_start_time_.is_null()); 322 DCHECK(load_start_time_.is_null());
323 load_start_time_ = base::TimeTicks::Now(); 323 load_start_time_ = base::TimeTicks::Now();
324 324
325 content::PageTransition transition = content::PAGE_TRANSITION_LINK; 325 content::PageTransition transition = content::PAGE_TRANSITION_LINK;
326 if (origin_ == ORIGIN_OMNIBOX_EXACT || origin_ == ORIGIN_OMNIBOX_EXACT_FULL) 326 if (origin_ == ORIGIN_OMNIBOX_EXACT || origin_ == ORIGIN_OMNIBOX_EXACT_FULL)
327 transition = content::PAGE_TRANSITION_TYPED; 327 transition = content::PAGE_TRANSITION_TYPED;
328 new_contents->controller().LoadURL(prerender_url_, referrer_, transition, 328 new_contents->controller().LoadURL(
329 std::string()); 329 prerender_url_,
330 content::Referrer(referrer_, WebKit::WebReferrerPolicyDefault),
331 transition, std::string());
330 } 332 }
331 333
332 bool PrerenderContents::GetChildId(int* child_id) const { 334 bool PrerenderContents::GetChildId(int* child_id) const {
333 CHECK(child_id); 335 CHECK(child_id);
334 DCHECK_GE(child_id_, -1); 336 DCHECK_GE(child_id_, -1);
335 *child_id = child_id_; 337 *child_id = child_id_;
336 return child_id_ != -1; 338 return child_id_ != -1;
337 } 339 }
338 340
339 bool PrerenderContents::GetRouteId(int* route_id) const { 341 bool PrerenderContents::GetRouteId(int* route_id) const {
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 bool PrerenderContents::IsCrossSiteNavigationPending() const { 676 bool PrerenderContents::IsCrossSiteNavigationPending() const {
675 if (!prerender_contents_.get() || !prerender_contents_->tab_contents()) 677 if (!prerender_contents_.get() || !prerender_contents_->tab_contents())
676 return false; 678 return false;
677 const TabContents* tab_contents = prerender_contents_->tab_contents(); 679 const TabContents* tab_contents = prerender_contents_->tab_contents();
678 return (tab_contents->GetSiteInstance() != 680 return (tab_contents->GetSiteInstance() !=
679 tab_contents->GetPendingSiteInstance()); 681 tab_contents->GetPendingSiteInstance());
680 } 682 }
681 683
682 684
683 } // namespace prerender 685 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698