| Index: chrome/browser/ui/webui/options/content_settings_handler.cc
|
| diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
|
| index 69c929d2a2a68985dc5cc71af2d83a3792132c5b..10fc81c9cd4a8497b8611e1d60fc121389482a13 100644
|
| --- a/chrome/browser/ui/webui/options/content_settings_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
|
| @@ -876,6 +876,16 @@ void ContentSettingsHandler::UpdateSettingDefaultFromModel(
|
|
|
| web_ui()->CallJavascriptFunction(
|
| "ContentSettings.setContentFilterSettingsValue", filter_settings);
|
| +
|
| + // We assume that special cases covered above to get |provider_id| are not
|
| + // needed in AreUserExceptionsAllowedForType().
|
| + bool maybe_enable_exceptions =
|
| + GetContentSettingsMap()->AreUserExceptionsAllowedForType(type);
|
| +
|
| + web_ui()->CallJavascriptFunction(
|
| + "ContentSettings.setUserExceptionsAllowed",
|
| + base::StringValue(ContentSettingsTypeToGroupName(type)),
|
| + base::FundamentalValue(maybe_enable_exceptions));
|
| }
|
|
|
| void ContentSettingsHandler::UpdateMediaSettingsFromPrefs(
|
| @@ -961,8 +971,7 @@ void ContentSettingsHandler::UpdateGeolocationExceptionsView() {
|
| // Don't add default settings.
|
| if (i->primary_pattern == ContentSettingsPattern::Wildcard() &&
|
| i->secondary_pattern == ContentSettingsPattern::Wildcard() &&
|
| - i
|
| - ->source != site_settings::kPreferencesSource) {
|
| + i->source != site_settings::kPreferencesSource) {
|
| continue;
|
| }
|
| all_patterns_settings[std::make_pair(i->primary_pattern, i->source)]
|
| @@ -1473,6 +1482,12 @@ void ContentSettingsHandler::RemoveException(const base::ListValue* args) {
|
| std::string type_string;
|
| CHECK(args->GetString(0, &type_string));
|
|
|
| + ContentSettingsType type = ContentSettingsTypeFromGroupName(type_string);
|
| +
|
| + // If preference exceptions are disabled for |type|, don't remove.
|
| + if (!GetContentSettingsMap()->AreUserExceptionsAllowedForType(type))
|
| + return;
|
| +
|
| // Zoom levels are no actual content type so we need to handle them
|
| // separately. They would not be recognized by
|
| // ContentSettingsTypeFromGroupName.
|
| @@ -1488,7 +1503,6 @@ void ContentSettingsHandler::RemoveException(const base::ListValue* args) {
|
| return;
|
| }
|
|
|
| - ContentSettingsType type = ContentSettingsTypeFromGroupName(type_string);
|
| RemoveExceptionFromHostContentSettingsMap(args, type);
|
|
|
| WebSiteSettingsUmaUtil::LogPermissionChange(
|
| @@ -1512,6 +1526,10 @@ void ContentSettingsHandler::SetException(const base::ListValue* args) {
|
| type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
|
| NOTREACHED();
|
| } else {
|
| + // If preference exceptions are disabled for |type|, don't set.
|
| + if (!GetContentSettingsMap()->AreUserExceptionsAllowedForType(type))
|
| + return;
|
| +
|
| HostContentSettingsMap* settings_map =
|
| mode == "normal" ? GetContentSettingsMap() :
|
| GetOTRContentSettingsMap();
|
|
|