Chromium Code Reviews| Index: components/content_settings/core/browser/host_content_settings_map.cc |
| diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc |
| index 52a6708ea74cd789da27059c168cb63c4776712f..2e033728dc3363d11b47a951135102873d815195 100644 |
| --- a/components/content_settings/core/browser/host_content_settings_map.cc |
| +++ b/components/content_settings/core/browser/host_content_settings_map.cc |
| @@ -55,6 +55,7 @@ const ProviderNamesSourceMapEntry kProviderNamesSourceMap[] = { |
| {"policy", content_settings::SETTING_SOURCE_POLICY}, |
| {"supervised_user", content_settings::SETTING_SOURCE_SUPERVISED}, |
| {"extension", content_settings::SETTING_SOURCE_EXTENSION}, |
| + {"notification_android", content_settings::SETTING_SOURCE_USER}, |
| {"preference", content_settings::SETTING_SOURCE_USER}, |
| {"default", content_settings::SETTING_SOURCE_USER}, |
| }; |
| @@ -384,6 +385,21 @@ void HostContentSettingsMap::SetWebsiteSettingCustomScope( |
| std::unique_ptr<base::Value> value) { |
| DCHECK(SupportsResourceIdentifier(content_type) || |
| resource_identifier.empty()); |
| +#if defined(OS_ANDROID) |
| + // Disallow wildcard notification content setting updates on Android. |
| + DCHECK(content_type != CONTENT_SETTINGS_TYPE_NOTIFICATIONS || |
| + GURL(primary_pattern.ToString()).is_valid()); |
| + // Disallow notification content setting updates that are not |
| + // ALLOW/BLOCK/DEFAULT on Android. |
| + DCHECK(content_type != CONTENT_SETTINGS_TYPE_NOTIFICATIONS || |
| + content_settings::ValueToContentSetting(value.get()) == |
| + CONTENT_SETTING_ALLOW || |
| + content_settings::ValueToContentSetting(value.get()) == |
| + CONTENT_SETTING_BLOCK || |
| + content_settings::ValueToContentSetting(value.get()) == |
| + CONTENT_SETTING_DEFAULT); |
|
raymes
2017/05/18 00:39:37
nit: let's leave this DCHECK of here for now. The
awdf
2017/05/19 17:59:57
Acknowledged.
|
| +#endif |
| + |
| UsedContentSettingsProviders(); |
| for (const auto& provider_pair : content_settings_providers_) { |
| @@ -910,4 +926,4 @@ HostContentSettingsMap::GetContentSettingValueAndPatterns( |
| void HostContentSettingsMap::SetClockForTesting( |
| std::unique_ptr<base::Clock> clock) { |
| pref_provider_->SetClockForTesting(std::move(clock)); |
| -} |
| +} |