Chromium Code Reviews| 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 990daf5487d587a0cd3dbdabe0bc8aa3914e6e2c..44c288f6d85cb1f151c708bc6c3f6c5e656c3704 100644 |
| --- a/chrome/browser/ui/webui/options/content_settings_handler.cc |
| +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc |
| @@ -30,6 +30,8 @@ |
| #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| #include "chrome/browser/notifications/desktop_notification_profile_util.h" |
| #include "chrome/browser/permissions/chooser_context_base.h" |
| +#include "chrome/browser/permissions/permission_uma_util.h" |
| +#include "chrome/browser/permissions/permission_util.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/browser_list.h" |
| #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" |
| @@ -1307,12 +1309,21 @@ void ContentSettingsHandler::RemoveExceptionFromHostContentSettingsMap( |
| mode == "normal" ? GetContentSettingsMap() : |
| GetOTRContentSettingsMap(); |
| if (settings_map) { |
| - settings_map->SetContentSettingCustomScope( |
| - ContentSettingsPattern::FromString(pattern), |
| + ContentSettingsPattern secondary_content_setting_pattern = |
| secondary_pattern.empty() |
| ? ContentSettingsPattern::Wildcard() |
| - : ContentSettingsPattern::FromString(secondary_pattern), |
| - type, std::string(), CONTENT_SETTING_DEFAULT); |
| + : ContentSettingsPattern::FromString(secondary_pattern); |
| + PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( |
| + Profile::FromWebUI(web_ui()), |
| + ContentSettingsPattern::FromString(pattern), |
| + secondary_content_setting_pattern, type, |
| + PermissionSourceUI::SITE_SETTINGS); |
| + scoped_revocation_reporter.SetCustomSettingsMap(settings_map); |
|
raymes
2016/07/26 01:18:31
I think we should just pass the OTR profile into t
stefanocs
2016/07/26 02:16:20
Done.
|
| + |
| + settings_map->SetContentSettingCustomScope( |
| + ContentSettingsPattern::FromString(pattern), |
|
raymes
2016/07/26 01:18:31
Can we pull this out above and have
ContentSetti
stefanocs
2016/07/26 02:16:20
Done.
|
| + secondary_content_setting_pattern, type, std::string(), |
| + CONTENT_SETTING_DEFAULT); |
| } |
| } |
| @@ -1482,6 +1493,13 @@ void ContentSettingsHandler::SetException(const base::ListValue* args) { |
| content_settings::ContentSettingFromString(setting, &setting_type); |
| DCHECK(result); |
| + PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( |
| + Profile::FromWebUI(web_ui()), |
| + ContentSettingsPattern::FromString(pattern), |
| + ContentSettingsPattern::Wildcard(), type, |
| + PermissionSourceUI::SITE_SETTINGS); |
| + scoped_revocation_reporter.SetCustomSettingsMap(settings_map); |
| + |
| settings_map->SetContentSettingCustomScope( |
| ContentSettingsPattern::FromString(pattern), |
| ContentSettingsPattern::Wildcard(), type, std::string(), setting_type); |