Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3149)

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 2180723002: Add revocation metrics from OIB and content setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@revocation-reporter
Patch Set: Add setter for settings map Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698