| OLD | NEW |
| 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 Destroy(FINAL_STATUS_RENDERER_CRASHED); | 556 Destroy(FINAL_STATUS_RENDERER_CRASHED); |
| 557 } | 557 } |
| 558 | 558 |
| 559 void PrerenderContents::DidStopLoading( | 559 void PrerenderContents::DidStopLoading( |
| 560 content::RenderViewHost* render_view_host) { | 560 content::RenderViewHost* render_view_host) { |
| 561 has_stopped_loading_ = true; | 561 has_stopped_loading_ = true; |
| 562 } | 562 } |
| 563 | 563 |
| 564 void PrerenderContents::DidStartProvisionalLoadForFrame( | 564 void PrerenderContents::DidStartProvisionalLoadForFrame( |
| 565 int64 frame_id, | 565 int64 frame_id, |
| 566 int64 parent_frame_id, |
| 566 bool is_main_frame, | 567 bool is_main_frame, |
| 567 const GURL& validated_url, | 568 const GURL& validated_url, |
| 568 bool is_error_page, | 569 bool is_error_page, |
| 569 RenderViewHost* render_view_host) { | 570 RenderViewHost* render_view_host) { |
| 570 if (is_main_frame) { | 571 if (is_main_frame) { |
| 571 if (!AddAliasURL(validated_url)) | 572 if (!AddAliasURL(validated_url)) |
| 572 return; | 573 return; |
| 573 | 574 |
| 574 // Usually, this event fires if the user clicks or enters a new URL. | 575 // Usually, this event fires if the user clicks or enters a new URL. |
| 575 // Neither of these can happen in the case of an invisible prerender. | 576 // Neither of these can happen in the case of an invisible prerender. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 bool PrerenderContents::IsCrossSiteNavigationPending() const { | 705 bool PrerenderContents::IsCrossSiteNavigationPending() const { |
| 705 if (!prerender_contents_.get() || !prerender_contents_->web_contents()) | 706 if (!prerender_contents_.get() || !prerender_contents_->web_contents()) |
| 706 return false; | 707 return false; |
| 707 const WebContents* web_contents = prerender_contents_->web_contents(); | 708 const WebContents* web_contents = prerender_contents_->web_contents(); |
| 708 return (web_contents->GetSiteInstance() != | 709 return (web_contents->GetSiteInstance() != |
| 709 web_contents->GetPendingSiteInstance()); | 710 web_contents->GetPendingSiteInstance()); |
| 710 } | 711 } |
| 711 | 712 |
| 712 | 713 |
| 713 } // namespace prerender | 714 } // namespace prerender |
| OLD | NEW |