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 <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
934 context)); | 934 context)); |
935 #endif | 935 #endif |
936 #if defined(OS_ANDROID) | 936 #if defined(OS_ANDROID) |
937 host->AddFilter(new EncryptedMediaMessageFilterAndroid()); | 937 host->AddFilter(new EncryptedMediaMessageFilterAndroid()); |
938 #endif | 938 #endif |
939 | 939 |
940 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 940 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
941 profile->IsOffTheRecord())); | 941 profile->IsOffTheRecord())); |
942 | 942 |
943 SendExtensionWebRequestStatusToHost(host); | 943 SendExtensionWebRequestStatusToHost(host); |
944 | |
945 RendererContentSettingRules rules; | |
946 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); | |
947 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | |
948 } | 944 } |
949 | 945 |
950 GURL ChromeContentBrowserClient::GetEffectiveURL( | 946 GURL ChromeContentBrowserClient::GetEffectiveURL( |
951 content::BrowserContext* browser_context, const GURL& url) { | 947 content::BrowserContext* browser_context, const GURL& url) { |
952 Profile* profile = Profile::FromBrowserContext(browser_context); | 948 Profile* profile = Profile::FromBrowserContext(browser_context); |
953 if (!profile) | 949 if (!profile) |
954 return url; | 950 return url; |
955 | 951 |
956 // If the input |url| should be assigned to the Instant renderer, make its | 952 // If the input |url| should be assigned to the Instant renderer, make its |
957 // effective URL distinct from other URLs on the search provider's domain. | 953 // effective URL distinct from other URLs on the search provider's domain. |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1269 } | 1265 } |
1270 #endif | 1266 #endif |
1271 | 1267 |
1272 ExtensionService* service = | 1268 ExtensionService* service = |
1273 extensions::ExtensionSystem::Get(profile)->extension_service(); | 1269 extensions::ExtensionSystem::Get(profile)->extension_service(); |
1274 if (!service) | 1270 if (!service) |
1275 return; | 1271 return; |
1276 | 1272 |
1277 const Extension* extension = service->extensions()->GetExtensionOrAppByURL( | 1273 const Extension* extension = service->extensions()->GetExtensionOrAppByURL( |
1278 site_instance->GetSiteURL()); | 1274 site_instance->GetSiteURL()); |
1275 | |
1276 bool inject_content_rules = !site_instance->GetProcess()->IsGuest() && | |
jochen (gone - plz use gerrit)
2013/11/28 22:23:30
from the description, the bug happens in platform
| |
1277 (!extension || !extension->is_platform_app()); | |
Charlie Reis
2013/11/27 17:35:55
This condition is really hard to read. Please pul
jochen (gone - plz use gerrit)
2013/11/28 22:23:30
what happens for other processes that contain a br
| |
1278 if (inject_content_rules) { | |
1279 RendererContentSettingRules rules; | |
1280 GetRendererContentSettingRules( | |
1281 profile->GetHostContentSettingsMap(), &rules); | |
1282 site_instance->GetProcess()->Send( | |
1283 new ChromeViewMsg_SetContentSettingRules(rules)); | |
Charlie Reis
2013/11/27 17:35:55
SiteInstanceGotProcess can be called multiple time
| |
1284 } | |
1285 | |
1279 if (!extension) | 1286 if (!extension) |
1280 return; | 1287 return; |
1281 | 1288 |
1282 service->process_map()->Insert(extension->id(), | 1289 service->process_map()->Insert(extension->id(), |
1283 site_instance->GetProcess()->GetID(), | 1290 site_instance->GetProcess()->GetID(), |
1284 site_instance->GetId()); | 1291 site_instance->GetId()); |
1285 BrowserThread::PostTask( | 1292 BrowserThread::PostTask( |
1286 BrowserThread::IO, | 1293 BrowserThread::IO, |
1287 FROM_HERE, | 1294 FROM_HERE, |
1288 base::Bind(&InfoMap::RegisterExtensionProcess, | 1295 base::Bind(&InfoMap::RegisterExtensionProcess, |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2631 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, | 2638 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, |
2632 allowed_file_handle_origins_) || | 2639 allowed_file_handle_origins_) || |
2633 IsHostAllowedByCommandLine(url, extension_set, | 2640 IsHostAllowedByCommandLine(url, extension_set, |
2634 switches::kAllowNaClFileHandleAPI); | 2641 switches::kAllowNaClFileHandleAPI); |
2635 #else | 2642 #else |
2636 return false; | 2643 return false; |
2637 #endif | 2644 #endif |
2638 } | 2645 } |
2639 | 2646 |
2640 } // namespace chrome | 2647 } // namespace chrome |
OLD | NEW |