| OLD | NEW |
| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ORIGINAL || | 326 if (origin_ == ORIGIN_OMNIBOX_ORIGINAL || |
| 327 origin_ == ORIGIN_OMNIBOX_CONSERVATIVE) { | 327 origin_ == ORIGIN_OMNIBOX_CONSERVATIVE) { |
| 328 transition = content::PAGE_TRANSITION_TYPED; | 328 transition = content::PAGE_TRANSITION_TYPED; |
| 329 } | 329 } |
| 330 new_contents->controller().LoadURL(prerender_url_, referrer_, transition, | 330 new_contents->controller().LoadURL( |
| 331 std::string()); | 331 prerender_url_, |
| 332 content::Referrer(referrer_, WebKit::WebReferrerPolicyDefault), |
| 333 transition, std::string()); |
| 332 } | 334 } |
| 333 | 335 |
| 334 bool PrerenderContents::GetChildId(int* child_id) const { | 336 bool PrerenderContents::GetChildId(int* child_id) const { |
| 335 CHECK(child_id); | 337 CHECK(child_id); |
| 336 DCHECK_GE(child_id_, -1); | 338 DCHECK_GE(child_id_, -1); |
| 337 *child_id = child_id_; | 339 *child_id = child_id_; |
| 338 return child_id_ != -1; | 340 return child_id_ != -1; |
| 339 } | 341 } |
| 340 | 342 |
| 341 bool PrerenderContents::GetRouteId(int* route_id) const { | 343 bool PrerenderContents::GetRouteId(int* route_id) const { |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 bool PrerenderContents::IsCrossSiteNavigationPending() const { | 678 bool PrerenderContents::IsCrossSiteNavigationPending() const { |
| 677 if (!prerender_contents_.get() || !prerender_contents_->tab_contents()) | 679 if (!prerender_contents_.get() || !prerender_contents_->tab_contents()) |
| 678 return false; | 680 return false; |
| 679 const TabContents* tab_contents = prerender_contents_->tab_contents(); | 681 const TabContents* tab_contents = prerender_contents_->tab_contents(); |
| 680 return (tab_contents->GetSiteInstance() != | 682 return (tab_contents->GetSiteInstance() != |
| 681 tab_contents->GetPendingSiteInstance()); | 683 tab_contents->GetPendingSiteInstance()); |
| 682 } | 684 } |
| 683 | 685 |
| 684 | 686 |
| 685 } // namespace prerender | 687 } // namespace prerender |
| OLD | NEW |