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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 virtual void OnStartDownload(WebContents* source, | 147 virtual void OnStartDownload(WebContents* source, |
148 DownloadItem* download) OVERRIDE { | 148 DownloadItem* download) OVERRIDE { |
149 // Prerendered pages should never be able to download files. | 149 // Prerendered pages should never be able to download files. |
150 NOTREACHED(); | 150 NOTREACHED(); |
151 } | 151 } |
152 | 152 |
153 virtual bool ShouldCreateWebContents( | 153 virtual bool ShouldCreateWebContents( |
154 WebContents* web_contents, | 154 WebContents* web_contents, |
155 int route_id, | 155 int route_id, |
156 WindowContainerType window_container_type, | 156 WindowContainerType window_container_type, |
157 const string16& frame_name) OVERRIDE { | 157 const string16& frame_name, |
| 158 const GURL& target_url) OVERRIDE { |
158 // Since we don't want to permit child windows that would have a | 159 // Since we don't want to permit child windows that would have a |
159 // window.opener property, terminate prerendering. | 160 // window.opener property, terminate prerendering. |
160 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); | 161 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); |
161 // Cancel the popup. | 162 // Cancel the popup. |
162 return false; | 163 return false; |
163 } | 164 } |
164 | 165 |
165 virtual bool OnGoToEntryOffset(int offset) OVERRIDE { | 166 virtual bool OnGoToEntryOffset(int offset) OVERRIDE { |
166 // This isn't allowed because the history merge operation | 167 // This isn't allowed because the history merge operation |
167 // does not work if there are renderer issued challenges. | 168 // does not work if there are renderer issued challenges. |
(...skipping 536 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 |