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 | |
946 // static | |
947 void ChromeContentBrowserClient::SetContentSettingRules( | |
948 content::RenderViewHost* host) { | |
949 // <*view> guests should not be affected by ContentSettingRules. | |
950 if (host->GetProcess()->IsGuest()) | |
951 return; | |
952 | |
953 SiteInstance* site_instance = host->GetSiteInstance(); | |
954 if (!site_instance) | |
955 return; | |
956 | |
957 Profile* profile = Profile::FromBrowserContext( | |
958 host->GetProcess()->GetBrowserContext()); | |
959 if (!profile) | |
960 return; | |
961 | |
962 ExtensionService* extension_service = | |
963 extensions::ExtensionSystem::Get(profile)->extension_service(); | |
964 if (!extension_service) | |
965 return; | |
966 | |
967 // Extensions should not be affected by ContentSettingRules. | |
968 const Extension* extension = extension_service->extensions()-> | |
969 GetHostedAppByURL(site_instance->GetSiteURL()); | |
970 if (extension) | |
971 return; | |
944 | 972 |
945 RendererContentSettingRules rules; | 973 RendererContentSettingRules rules; |
946 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); | 974 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), |
947 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 975 &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.
| |
976 host->Send(new ChromeViewMsg_SetContentSettingRules( | |
977 host->GetRoutingID(), rules)); | |
978 } | |
979 | |
980 void ChromeContentBrowserClient::RenderViewReady( | |
981 content::RenderViewHost* host) { | |
982 SetContentSettingRules(host); | |
948 } | 983 } |
949 | 984 |
950 GURL ChromeContentBrowserClient::GetEffectiveURL( | 985 GURL ChromeContentBrowserClient::GetEffectiveURL( |
951 content::BrowserContext* browser_context, const GURL& url) { | 986 content::BrowserContext* browser_context, const GURL& url) { |
952 Profile* profile = Profile::FromBrowserContext(browser_context); | 987 Profile* profile = Profile::FromBrowserContext(browser_context); |
953 if (!profile) | 988 if (!profile) |
954 return url; | 989 return url; |
955 | 990 |
956 // If the input |url| should be assigned to the Instant renderer, make its | 991 // 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. | 992 // effective URL distinct from other URLs on the search provider's domain. |
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2629 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, | 2664 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, |
2630 allowed_file_handle_origins_) || | 2665 allowed_file_handle_origins_) || |
2631 IsHostAllowedByCommandLine(url, extension_set, | 2666 IsHostAllowedByCommandLine(url, extension_set, |
2632 switches::kAllowNaClFileHandleAPI); | 2667 switches::kAllowNaClFileHandleAPI); |
2633 #else | 2668 #else |
2634 return false; | 2669 return false; |
2635 #endif | 2670 #endif |
2636 } | 2671 } |
2637 | 2672 |
2638 } // namespace chrome | 2673 } // namespace chrome |
OLD | NEW |