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

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

Issue 2772513004: Disable permissions embargo for plugins. (Closed)
Patch Set: Add todo Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/permission_decision_auto_blocker.cc
diff --git a/chrome/browser/permissions/permission_decision_auto_blocker.cc b/chrome/browser/permissions/permission_decision_auto_blocker.cc
index 4dcc5fa94e37834bcfe3a68b5c09ad93c9e9c56f..a41d4ba59e1b39117fbbc976e00d49bc2ba6dabd 100644
--- a/chrome/browser/permissions/permission_decision_auto_blocker.cc
+++ b/chrome/browser/permissions/permission_decision_auto_blocker.cc
@@ -279,7 +279,17 @@ bool PermissionDecisionAutoBlocker::RecordDismissAndEmbargo(
int current_dismissal_count = RecordActionInWebsiteSettings(
url, permission, kPromptDismissCountKey, profile_);
+ // TODO(dominickn): ideally we would have a method
+ // PermissionContextBase::ShouldEmbargoAfterRepeatedDismissals() to specify
+ // if a permission is opted in. This is difficult right now because:
+ // 1. PermissionQueueController needs to call this method at a point where it
+ // does not have a PermissionContextBase available
+ // 2. Not calling RecordDismissAndEmbargo means no repeated dismissal metrics
+ // are recorded
+ // For now, only plugins are explicitly opted out. We should think about how
+ // to make this nicer once PermissionQueueController is removed.
if (base::FeatureList::IsEnabled(features::kBlockPromptsIfDismissedOften) &&
+ permission != CONTENT_SETTINGS_TYPE_PLUGINS &&
current_dismissal_count >= g_prompt_dismissals_before_block) {
PlaceUnderEmbargo(url, permission, kPermissionDismissalEmbargoKey);
return true;
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698