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

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

Issue 2386193004: Make all PermissionDecisionAutoBlocker methods static. (Closed)
Patch Set: Address comments Created 4 years, 2 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 43d863f4eb2f8eb870de5128257dc71e611da64f..89ecfc7f77e2b920d393b9493026a214277a7408 100644
--- a/chrome/browser/permissions/permission_decision_auto_blocker.h
+++ b/chrome/browser/permissions/permission_decision_auto_blocker.h
@@ -19,8 +19,8 @@ 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|.
+ // Returns the current number of dismisses recorded for |permission| type at
+ // |url|.
static int GetDismissCount(const GURL& url,
content::PermissionType permission,
Profile* profile);
@@ -31,15 +31,24 @@ class PermissionDecisionAutoBlocker {
content::PermissionType permission,
Profile* profile);
- explicit PermissionDecisionAutoBlocker(Profile* profile);
+ // Records that a dismissal of a prompt for |permission| was made.
+ static int RecordDismiss(const GURL& url,
+ content::PermissionType permission,
+ Profile* profile);
// Records that an ignore of a prompt for |permission| was made.
- int RecordIgnore(const GURL& url, content::PermissionType permission);
+ static int RecordIgnore(const GURL& url,
+ content::PermissionType permission,
+ Profile* profile);
// Records that a dismissal of a prompt for |permission| was made, and returns
// true if this dismissal should be considered a block. False otherwise.
- bool ShouldChangeDismissalToBlock(const GURL& url,
- content::PermissionType permission);
+ static bool ShouldChangeDismissalToBlock(const GURL& url,
+ content::PermissionType permission,
+ Profile* profile);
+
+ // Updates the threshold to start blocking prompts from the field trial.
+ static void UpdateFromVariations();
private:
friend class PermissionContextBaseTests;
@@ -48,11 +57,7 @@ class PermissionDecisionAutoBlocker {
static const char kPromptDismissCountKey[];
static const char kPromptIgnoreCountKey[];
- // Updates |prompt_dismissals_before_block_|.
- void UpdateFromVariations();
-
- Profile *profile_;
- int prompt_dismissals_before_block_;
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionDecisionAutoBlocker);
};
#endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_
« no previous file with comments | « chrome/browser/permissions/permission_context_base.cc ('k') | chrome/browser/permissions/permission_decision_auto_blocker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698