Chromium Code Reviews| 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..317fc7fcb1de47f2cc2823759a4a81cc3c385e2f 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 number of prompts before blocking. |
|
raymes
2016/10/05 05:02:32
nit: Updates the threshold at which to start block
dominickn
2016/10/05 05:55:30
Done.
|
| + static void UpdateFromVariations(); |
| private: |
|
raymes
2016/10/05 05:02:32
nit: DISALLOW_IMPLICIT_CONSTRUCTORS
dominickn
2016/10/05 05:55:30
Done.
|
| friend class PermissionContextBaseTests; |
| @@ -47,12 +56,6 @@ class PermissionDecisionAutoBlocker { |
| // Keys used for storing count data in a website setting. |
| static const char kPromptDismissCountKey[]; |
| static const char kPromptIgnoreCountKey[]; |
| - |
| - // Updates |prompt_dismissals_before_block_|. |
| - void UpdateFromVariations(); |
| - |
| - Profile *profile_; |
| - int prompt_dismissals_before_block_; |
| }; |
| #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ |