Chromium Code Reviews| Index: chrome/browser/chrome_content_browser_client.cc |
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
| index 84a118f400868bb78d7e28382ba5bd85e6fe843c..b4e43b3bc7d753a9808f05650e7608df1ee685c3 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -941,10 +941,45 @@ void ChromeContentBrowserClient::RenderProcessHostCreated( |
| profile->IsOffTheRecord())); |
| SendExtensionWebRequestStatusToHost(host); |
| +} |
| + |
| +// static |
| +void ChromeContentBrowserClient::SetContentSettingRules( |
| + content::RenderViewHost* host) { |
| + // <*view> guests should not be affected by ContentSettingRules. |
| + if (host->GetProcess()->IsGuest()) |
| + return; |
| + |
| + SiteInstance* site_instance = host->GetSiteInstance(); |
| + if (!site_instance) |
| + return; |
| + |
| + Profile* profile = Profile::FromBrowserContext( |
| + host->GetProcess()->GetBrowserContext()); |
| + if (!profile) |
| + return; |
| + |
| + ExtensionService* extension_service = |
| + extensions::ExtensionSystem::Get(profile)->extension_service(); |
| + if (!extension_service) |
| + return; |
| + |
| + // Extensions should not be affected by ContentSettingRules. |
| + const Extension* extension = extension_service->extensions()-> |
| + GetHostedAppByURL(site_instance->GetSiteURL()); |
| + if (extension) |
| + return; |
| RendererContentSettingRules rules; |
| - GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |
| - host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); |
| + GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), |
| + &rules); |
|
markusheintz_
2013/11/25 18:04:41
nit: I guess this fits into the line above.
Fady Samuel
2013/11/25 21:54:02
Done.
|
| + host->Send(new ChromeViewMsg_SetContentSettingRules( |
| + host->GetRoutingID(), rules)); |
| +} |
| + |
| +void ChromeContentBrowserClient::RenderViewReady( |
| + content::RenderViewHost* host) { |
| + SetContentSettingRules(host); |
| } |
| GURL ChromeContentBrowserClient::GetEffectiveURL( |