| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "content/public/browser/permission_type.h" | 10 #include "content/public/browser/permission_type.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 bool ShouldChangeDismissalToBlock(const GURL& url, | 41 bool ShouldChangeDismissalToBlock(const GURL& url, |
| 42 content::PermissionType permission); | 42 content::PermissionType permission); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 friend class PermissionContextBaseTests; | 45 friend class PermissionContextBaseTests; |
| 46 | 46 |
| 47 // Keys used for storing count data in a website setting. | 47 // Keys used for storing count data in a website setting. |
| 48 static const char kPromptDismissCountKey[]; | 48 static const char kPromptDismissCountKey[]; |
| 49 static const char kPromptIgnoreCountKey[]; | 49 static const char kPromptIgnoreCountKey[]; |
| 50 | 50 |
| 51 // Returns the current number of actions recorded under |key| for |permission| | |
| 52 // type at |url|. | |
| 53 static int GetActionCount(const GURL& url, | |
| 54 content::PermissionType permission, | |
| 55 const char* key, | |
| 56 Profile* profile); | |
| 57 | |
| 58 // Records that the user performed an action for a prompt of type |permission| | |
| 59 // on |url| to a website setting keyed by |key|. Returns the total number of | |
| 60 // |key| actions which have been performed for |url|. | |
| 61 int RecordActionInWebsiteSettings(const GURL& url, | |
| 62 content::PermissionType permission, | |
| 63 const char* key); | |
| 64 | |
| 65 // Updates |prompt_dismissals_before_block_|. | 51 // Updates |prompt_dismissals_before_block_|. |
| 66 void UpdateFromVariations(); | 52 void UpdateFromVariations(); |
| 67 | 53 |
| 68 Profile *profile_; | 54 Profile *profile_; |
| 69 int prompt_dismissals_before_block_; | 55 int prompt_dismissals_before_block_; |
| 70 }; | 56 }; |
| 71 | 57 |
| 72 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ | 58 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_ |
| OLD | NEW |