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

Unified Diff: chrome/browser/ui/website_settings/website_settings.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
Index: chrome/browser/ui/website_settings/website_settings.cc
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc
index 5853d3e4094cda5b3bf438ef21ed1433af29b61d..a5c77c35ed24241a5222980fb71b634c8b700794 100644
--- a/chrome/browser/ui/website_settings/website_settings.cc
+++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -288,15 +288,6 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type,
UMA_HISTOGRAM_ENUMERATION(
"WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value,
num_values);
- // Trigger Rappor sampling if it is a permission revoke action.
- // TODO(tsergeant): Integrate this with the revocation recording performed
- // in the permissions layer. See crbug.com/469221.
- content::PermissionType permission_type;
- if (PermissionUtil::GetPermissionType(type, &permission_type)) {
- PermissionUmaUtil::PermissionRevoked(permission_type,
- PermissionSourceUI::OIB,
- this->site_url_, this->profile_);
- }
}
// This is technically redundant given the histogram above, but putting the
@@ -304,6 +295,10 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type,
// compare it against other kinds of actions in WebsiteSettings[PopupView].
RecordWebsiteSettingsAction(WEBSITE_SETTINGS_CHANGED_PERMISSION);
+ PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter(
+ this->profile_, this->site_url_, this->site_url_, type,
+ PermissionSourceUI::OIB);
+
content_settings_->SetNarrowestContentSetting(site_url_, site_url_, type,
setting);

Powered by Google App Engine
This is Rietveld 408576698