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

Unified Diff: chrome/browser/permissions/permission_context_base.cc

Issue 2184823007: Add a feature which, when enabled, blocks permissions after X prompt dismissals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_context_base.cc
diff --git a/chrome/browser/permissions/permission_context_base.cc b/chrome/browser/permissions/permission_context_base.cc
index f0fc52cbb09308d88950e6bfdf851895201c2cd0..696f51295c0cb14c01c455cf86d406cf1238468b 100644
--- a/chrome/browser/permissions/permission_context_base.cc
+++ b/chrome/browser/permissions/permission_context_base.cc
@@ -211,6 +211,15 @@ void PermissionContextBase::PermissionDecided(
#if !defined(OS_ANDROID)
// Infobar persistence and its related UMA is tracked on the infobar
// controller directly.
+
+ // Check if we should convert a dismiss decision into a block decision. This
+ // is gated on enabling the kBlockPromptsIfDismissedOften feature.
+ if (!persist && PermissionUtil::ShouldChangeDismissalToBlock(
+ profile_, requesting_origin, permission_type_)) {
+ persist = true;
+ content_setting = CONTENT_SETTING_BLOCK;
+ }
+
if (persist) {
DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
content_setting == CONTENT_SETTING_BLOCK);

Powered by Google App Engine
This is Rietveld 408576698