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

Unified Diff: chrome/browser/permissions/permission_util.h

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/permissions/permission_util.h
diff --git a/chrome/browser/permissions/permission_util.h b/chrome/browser/permissions/permission_util.h
index b63b2e084485bf9b157a7809fd4a0e049d34af81..755ebcff5af4a493ab72289df609371f28028d25 100644
--- a/chrome/browser/permissions/permission_util.h
+++ b/chrome/browser/permissions/permission_util.h
@@ -12,6 +12,7 @@
#include "components/content_settings/core/common/content_settings_types.h"
#include "url/gurl.h"
+class HostContentSettingsMap;
class Profile;
namespace content {
@@ -41,7 +42,9 @@ class PermissionUtil {
// A scoped class that will check the current resolved content setting on
// construction and report a revocation metric accordingly if the revocation
- // condition is met (from ALLOW to something else).
+ // condition is met (from ALLOW to something else). By default,
+ // |settings_map_| is obtained from |profile_|, but it can be changed with the
+ // setter if necessary.
class ScopedRevocationReporter {
public:
ScopedRevocationReporter(Profile* profile,
@@ -50,10 +53,19 @@ class PermissionUtil {
ContentSettingsType content_type,
PermissionSourceUI source_ui);
+ ScopedRevocationReporter(Profile* profile,
+ const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern,
+ ContentSettingsType content_type,
+ PermissionSourceUI source_ui);
+
+ void SetCustomSettingsMap(HostContentSettingsMap* settings_map);
+
~ScopedRevocationReporter();
private:
Profile* profile_;
+ HostContentSettingsMap* settings_map_;
const GURL primary_url_;
const GURL secondary_url_;
ContentSettingsType content_type_;

Powered by Google App Engine
This is Rietveld 408576698