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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |