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 new_contents->controller().LoadURL(prerender_url_, | 322 PageTransition::Type transition = PageTransition::LINK; |
323 referrer_, PageTransition::LINK, | 323 if (origin_ == ORIGIN_OMNIBOX_ORIGINAL || |
cbentzel
2011/10/10 15:55:15
Perhaps an IsOmniboxOrigin() helper?
dominich
2011/10/10 15:57:47
I considered it, but these two origins are only go
| |
324 origin_ == ORIGIN_OMNIBOX_CONSERVATIVE) { | |
325 transition = PageTransition::TYPED; | |
326 } | |
327 new_contents->controller().LoadURL(prerender_url_, referrer_, transition, | |
324 std::string()); | 328 std::string()); |
325 } | 329 } |
326 | 330 |
327 bool PrerenderContents::GetChildId(int* child_id) const { | 331 bool PrerenderContents::GetChildId(int* child_id) const { |
328 CHECK(child_id); | 332 CHECK(child_id); |
329 DCHECK_GE(child_id_, -1); | 333 DCHECK_GE(child_id_, -1); |
330 *child_id = child_id_; | 334 *child_id = child_id_; |
331 return child_id_ != -1; | 335 return child_id_ != -1; |
332 } | 336 } |
333 | 337 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
654 bool PrerenderContents::IsCrossSiteNavigationPending() const { | 658 bool PrerenderContents::IsCrossSiteNavigationPending() const { |
655 if (!prerender_contents_.get() || !prerender_contents_->tab_contents()) | 659 if (!prerender_contents_.get() || !prerender_contents_->tab_contents()) |
656 return false; | 660 return false; |
657 const TabContents* tab_contents = prerender_contents_->tab_contents(); | 661 const TabContents* tab_contents = prerender_contents_->tab_contents(); |
658 return (tab_contents->GetSiteInstance() != | 662 return (tab_contents->GetSiteInstance() != |
659 tab_contents->GetPendingSiteInstance()); | 663 tab_contents->GetPendingSiteInstance()); |
660 } | 664 } |
661 | 665 |
662 | 666 |
663 } // namespace prerender | 667 } // namespace prerender |
OLD | NEW |