| 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 <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
| 29 #include "content/public/browser/render_process_host.h" | 29 #include "content/public/browser/render_process_host.h" |
| 30 #include "content/public/browser/render_view_host.h" | 30 #include "content/public/browser/render_view_host.h" |
| 31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/browser/web_contents_delegate.h" | 32 #include "content/public/browser/web_contents_delegate.h" |
| 33 #include "content/public/browser/web_contents_view.h" | 33 #include "content/public/browser/web_contents_view.h" |
| 34 #include "ui/gfx/rect.h" | 34 #include "ui/gfx/rect.h" |
| 35 | 35 |
| 36 using content::DownloadItem; | 36 using content::DownloadItem; |
| 37 using content::OpenURLParams; | 37 using content::OpenURLParams; |
| 38 using content::RenderViewHost; |
| 38 using content::WebContents; | 39 using content::WebContents; |
| 39 | 40 |
| 40 namespace prerender { | 41 namespace prerender { |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| 43 | 44 |
| 44 // Compares URLs ignoring any ref for the purposes of matching URLs when | 45 // Compares URLs ignoring any ref for the purposes of matching URLs when |
| 45 // prerendering. | 46 // prerendering. |
| 46 struct PrerenderURLPredicate { | 47 struct PrerenderURLPredicate { |
| 47 explicit PrerenderURLPredicate(const GURL& url) | 48 explicit PrerenderURLPredicate(const GURL& url) |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 bool PrerenderContents::IsCrossSiteNavigationPending() const { | 657 bool PrerenderContents::IsCrossSiteNavigationPending() const { |
| 657 if (!prerender_contents_.get() || !prerender_contents_->web_contents()) | 658 if (!prerender_contents_.get() || !prerender_contents_->web_contents()) |
| 658 return false; | 659 return false; |
| 659 const WebContents* web_contents = prerender_contents_->web_contents(); | 660 const WebContents* web_contents = prerender_contents_->web_contents(); |
| 660 return (web_contents->GetSiteInstance() != | 661 return (web_contents->GetSiteInstance() != |
| 661 web_contents->GetPendingSiteInstance()); | 662 web_contents->GetPendingSiteInstance()); |
| 662 } | 663 } |
| 663 | 664 |
| 664 | 665 |
| 665 } // namespace prerender | 666 } // namespace prerender |
| OLD | NEW |