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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2454563003: Fix web accessible resource checks in ShouldAllowOpenURL (Closed)
Patch Set: Round 2 of Devlin's comments Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/extensions/chrome_content_browser_client_extensions_part.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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 #if defined(ENABLE_EXTENSIONS) 1184 #if defined(ENABLE_EXTENSIONS)
1185 return ChromeContentBrowserClientExtensionsPart::CanCommitURL( 1185 return ChromeContentBrowserClientExtensionsPart::CanCommitURL(
1186 process_host, url); 1186 process_host, url);
1187 #else 1187 #else
1188 return true; 1188 return true;
1189 #endif 1189 #endif
1190 } 1190 }
1191 1191
1192 bool ChromeContentBrowserClient::ShouldAllowOpenURL( 1192 bool ChromeContentBrowserClient::ShouldAllowOpenURL(
1193 content::SiteInstance* site_instance, const GURL& url) { 1193 content::SiteInstance* site_instance, const GURL& url) {
1194 GURL from_url = site_instance->GetSiteURL();
1195
1196 #if defined(ENABLE_EXTENSIONS) 1194 #if defined(ENABLE_EXTENSIONS)
1197 bool result; 1195 bool result;
1198 if (ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL( 1196 if (ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL(
1199 site_instance, from_url, url, &result)) 1197 site_instance, url, &result))
1200 return result; 1198 return result;
1201 #endif 1199 #endif
1202 1200
1203 // Do not allow chrome://chrome-signin navigate to other chrome:// URLs, since 1201 // Do not allow chrome://chrome-signin navigate to other chrome:// URLs, since
1204 // the signin page may host untrusted web content. 1202 // the signin page may host untrusted web content.
1203 GURL from_url = site_instance->GetSiteURL();
1205 if (from_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL && 1204 if (from_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL &&
1206 url.SchemeIs(content::kChromeUIScheme) && 1205 url.SchemeIs(content::kChromeUIScheme) &&
1207 url.host_piece() != chrome::kChromeUIChromeSigninHost) { 1206 url.host_piece() != chrome::kChromeUIChromeSigninHost) {
1208 VLOG(1) << "Blocked navigation to " << url.spec() << " from " 1207 VLOG(1) << "Blocked navigation to " << url.spec() << " from "
1209 << chrome::kChromeUIChromeSigninURL; 1208 << chrome::kChromeUIChromeSigninURL;
1210 return false; 1209 return false;
1211 } 1210 }
1212 1211
1213 return true; 1212 return true;
1214 } 1213 }
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
3229 kWebRtcDevSwitchNames, 3228 kWebRtcDevSwitchNames,
3230 arraysize(kWebRtcDevSwitchNames)); 3229 arraysize(kWebRtcDevSwitchNames));
3231 } 3230 }
3232 } 3231 }
3233 #endif // defined(ENABLE_WEBRTC) 3232 #endif // defined(ENABLE_WEBRTC)
3234 3233
3235 std::unique_ptr<content::MemoryCoordinatorDelegate> 3234 std::unique_ptr<content::MemoryCoordinatorDelegate>
3236 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { 3235 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() {
3237 return memory::ChromeMemoryCoordinatorDelegate::Create(); 3236 return memory::ChromeMemoryCoordinatorDelegate::Create();
3238 } 3237 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/chrome_content_browser_client_extensions_part.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698