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

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

Issue 2506503003: Fix web accessible resource checks in ShouldAllowOpenURL for M55 (Closed)
Patch Set: Remove DWOC headers 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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 #if defined(ENABLE_EXTENSIONS) 1190 #if defined(ENABLE_EXTENSIONS)
1191 return ChromeContentBrowserClientExtensionsPart::CanCommitURL( 1191 return ChromeContentBrowserClientExtensionsPart::CanCommitURL(
1192 process_host, url); 1192 process_host, url);
1193 #else 1193 #else
1194 return true; 1194 return true;
1195 #endif 1195 #endif
1196 } 1196 }
1197 1197
1198 bool ChromeContentBrowserClient::ShouldAllowOpenURL( 1198 bool ChromeContentBrowserClient::ShouldAllowOpenURL(
1199 content::SiteInstance* site_instance, const GURL& url) { 1199 content::SiteInstance* site_instance, const GURL& url) {
1200 GURL from_url = site_instance->GetSiteURL();
1201
1202 #if defined(ENABLE_EXTENSIONS) 1200 #if defined(ENABLE_EXTENSIONS)
1203 bool result; 1201 bool result;
1204 if (ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL( 1202 if (ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL(
1205 site_instance, from_url, url, &result)) 1203 site_instance, url, &result))
1206 return result; 1204 return result;
1207 #endif 1205 #endif
1208 1206
1209 // Do not allow chrome://chrome-signin navigate to other chrome:// URLs, since 1207 // Do not allow chrome://chrome-signin navigate to other chrome:// URLs, since
1210 // the signin page may host untrusted web content. 1208 // the signin page may host untrusted web content.
1209 GURL from_url = site_instance->GetSiteURL();
1211 if (from_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL && 1210 if (from_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL &&
1212 url.SchemeIs(content::kChromeUIScheme) && 1211 url.SchemeIs(content::kChromeUIScheme) &&
1213 url.host_piece() != chrome::kChromeUIChromeSigninHost) { 1212 url.host_piece() != chrome::kChromeUIChromeSigninHost) {
1214 VLOG(1) << "Blocked navigation to " << url.spec() << " from " 1213 VLOG(1) << "Blocked navigation to " << url.spec() << " from "
1215 << chrome::kChromeUIChromeSigninURL; 1214 << chrome::kChromeUIChromeSigninURL;
1216 return false; 1215 return false;
1217 } 1216 }
1218 1217
1219 return true; 1218 return true;
1220 } 1219 }
(...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after
3288 if (channel <= kMaxDisableEncryptionChannel) { 3287 if (channel <= kMaxDisableEncryptionChannel) {
3289 static const char* const kWebRtcDevSwitchNames[] = { 3288 static const char* const kWebRtcDevSwitchNames[] = {
3290 switches::kDisableWebRtcEncryption, 3289 switches::kDisableWebRtcEncryption,
3291 }; 3290 };
3292 to_command_line->CopySwitchesFrom(from_command_line, 3291 to_command_line->CopySwitchesFrom(from_command_line,
3293 kWebRtcDevSwitchNames, 3292 kWebRtcDevSwitchNames,
3294 arraysize(kWebRtcDevSwitchNames)); 3293 arraysize(kWebRtcDevSwitchNames));
3295 } 3294 }
3296 } 3295 }
3297 #endif // defined(ENABLE_WEBRTC) 3296 #endif // defined(ENABLE_WEBRTC)
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