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

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

Issue 2250893002: Permission Action Reporting: Add num_prior_* fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@par-new-fields-proto
Patch Set: todo Created 4 years, 4 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_decision_auto_blocker.h
diff --git a/chrome/browser/permissions/permission_decision_auto_blocker.h b/chrome/browser/permissions/permission_decision_auto_blocker.h
index 997ac062388865448b6494a4e03d181a2dcb7198..6f65f4a8102d180ee41be2a322f0c887a41a72c3 100644
--- a/chrome/browser/permissions/permission_decision_auto_blocker.h
+++ b/chrome/browser/permissions/permission_decision_auto_blocker.h
@@ -19,6 +19,18 @@ class PermissionDecisionAutoBlocker {
static void RemoveCountsByUrl(Profile* profile,
base::Callback<bool(const GURL& url)> filter);
+ // Returns the current number of dismisses recorded for |permission|
+ // type at |url|.
+ static int GetDismissCount(const GURL& url,
+ content::PermissionType permission,
+ Profile* profile);
+
+ // Returns the current number of ignores recorded for |permission|
+ // type at |url|.
+ static int GetIgnoreCount(const GURL& url,
+ content::PermissionType permission,
+ Profile* profile);
+
explicit PermissionDecisionAutoBlocker(Profile* profile);
// Records that an ignore of a prompt for |permission| was made.
@@ -31,8 +43,6 @@ class PermissionDecisionAutoBlocker {
private:
friend class PermissionContextBaseTests;
- friend class PermissionDecisionAutoBlockerUnitTest;
- friend class RemovePermissionPromptCountsTest;
// Keys used for storing count data in a website setting.
static const char kPromptDismissCountKey[];
@@ -40,9 +50,10 @@ class PermissionDecisionAutoBlocker {
// Returns the current number of actions recorded under |key| for |permission|
// type at |url|.
- int GetActionCountForTest(const GURL& url,
+ static int GetActionCount(const GURL& url,
content::PermissionType permission,
- const char* key);
+ const char* key,
+ Profile* profile);
// Records that the user performed an action for a prompt of type |permission|
// on |url| to a website setting keyed by |key|. Returns the total number of

Powered by Google App Engine
This is Rietveld 408576698