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

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: Rebase 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 ad39bb6d1194537cca56ba2c07ff5397d1291a2a..0fa5f8ff5df8aa0a334e498e0d2af7895840533e 100644
--- a/chrome/browser/ui/website_settings/website_settings.cc
+++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -287,15 +287,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
@@ -303,6 +294,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);
« no previous file with comments | « chrome/browser/permissions/permission_util_unittest.cc ('k') | chrome/browser/ui/webui/options/content_settings_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698