Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: chrome/browser/prerender/prerender_contents.cc

Issue 9837074: Make it so that allow_js_access: false can be used with background pages created by window.open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indentation. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/app_background_page_apitest.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_background_page_apitest.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698