| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 Source<RenderViewHostDelegate>(GetRenderViewHostDelegate())); | 312 Source<RenderViewHostDelegate>(GetRenderViewHostDelegate())); |
| 313 | 313 |
| 314 // Register for new windows from any source. | 314 // Register for new windows from any source. |
| 315 notification_registrar_.Add( | 315 notification_registrar_.Add( |
| 316 this, content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, | 316 this, content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, |
| 317 Source<TabContents>(new_contents)); | 317 Source<TabContents>(new_contents)); |
| 318 | 318 |
| 319 DCHECK(load_start_time_.is_null()); | 319 DCHECK(load_start_time_.is_null()); |
| 320 load_start_time_ = base::TimeTicks::Now(); | 320 load_start_time_ = base::TimeTicks::Now(); |
| 321 | 321 |
| 322 PageTransition::Type transition = PageTransition::LINK; | 322 content::PageTransition transition = content::PAGE_TRANSITION_LINK; |
| 323 if (origin_ == ORIGIN_OMNIBOX_ORIGINAL || | 323 if (origin_ == ORIGIN_OMNIBOX_ORIGINAL || |
| 324 origin_ == ORIGIN_OMNIBOX_CONSERVATIVE) { | 324 origin_ == ORIGIN_OMNIBOX_CONSERVATIVE) { |
| 325 transition = PageTransition::TYPED; | 325 transition = content::PAGE_TRANSITION_TYPED; |
| 326 } | 326 } |
| 327 new_contents->controller().LoadURL(prerender_url_, referrer_, transition, | 327 new_contents->controller().LoadURL(prerender_url_, referrer_, transition, |
| 328 std::string()); | 328 std::string()); |
| 329 } | 329 } |
| 330 | 330 |
| 331 bool PrerenderContents::GetChildId(int* child_id) const { | 331 bool PrerenderContents::GetChildId(int* child_id) const { |
| 332 CHECK(child_id); | 332 CHECK(child_id); |
| 333 DCHECK_GE(child_id_, -1); | 333 DCHECK_GE(child_id_, -1); |
| 334 *child_id = child_id_; | 334 *child_id = child_id_; |
| 335 return child_id_ != -1; | 335 return child_id_ != -1; |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 bool PrerenderContents::IsCrossSiteNavigationPending() const { | 658 bool PrerenderContents::IsCrossSiteNavigationPending() const { |
| 659 if (!prerender_contents_.get() || !prerender_contents_->tab_contents()) | 659 if (!prerender_contents_.get() || !prerender_contents_->tab_contents()) |
| 660 return false; | 660 return false; |
| 661 const TabContents* tab_contents = prerender_contents_->tab_contents(); | 661 const TabContents* tab_contents = prerender_contents_->tab_contents(); |
| 662 return (tab_contents->GetSiteInstance() != | 662 return (tab_contents->GetSiteInstance() != |
| 663 tab_contents->GetPendingSiteInstance()); | 663 tab_contents->GetPendingSiteInstance()); |
| 664 } | 664 } |
| 665 | 665 |
| 666 | 666 |
| 667 } // namespace prerender | 667 } // namespace prerender |
| OLD | NEW |