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

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: Improve test 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 8ce7f18b287fe0885a835bc862d313c02bbf2370..8e451b50f6782a09d3d64286d7a4cc2641973139 100644
--- a/chrome/browser/permissions/permission_context_base.cc
+++ b/chrome/browser/permissions/permission_context_base.cc
@@ -216,6 +216,15 @@ void PermissionContextBase::PermissionDecided(
PermissionRequestGestureType gesture_type =
user_gesture ? PermissionRequestGestureType::GESTURE
: PermissionRequestGestureType::NO_GESTURE;
+
+ // 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;
raymes 2016/07/28 08:07:50 Hmm I think right now this will cause PermissionUm
kcarattini 2016/07/28 08:54:49 Is that not what we want? Do we want to measure so
dominickn 2016/08/01 01:08:51 With respect to metrics, we have a couple of paths
dominickn 2016/08/01 01:08:51 This was a deliberate choice - I wanted the trigge
raymes 2016/08/01 05:09:11 This is supposed to measure a user's action on the
kcarattini 2016/08/01 07:09:52 As discussed, I think we should move this discussi
+ 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