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

Unified Diff: chrome/browser/permissions/permission_queue_controller.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_queue_controller.cc
diff --git a/chrome/browser/permissions/permission_queue_controller.cc b/chrome/browser/permissions/permission_queue_controller.cc
index 3382aaadc0e6deedeec7514712f664eb18699061..26a885c40b0a82f75b25f5e96a66f64e9d4ae751 100644
--- a/chrome/browser/permissions/permission_queue_controller.cc
+++ b/chrome/browser/permissions/permission_queue_controller.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/permissions/permission_request.h"
#include "chrome/browser/permissions/permission_request_id.h"
#include "chrome/browser/permissions/permission_uma_util.h"
+#include "chrome/browser/permissions/permission_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -212,6 +213,15 @@ void PermissionQueueController::OnPermissionSet(const PermissionRequestID& id,
bool allowed) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ // Check if we should convert a dismiss decision into a block decision. This
+ // is gated on enabling the kBlockPromptsIfDismissedOften feature.
+ if (!update_content_setting &&
+ PermissionUtil::ShouldChangeDismissalToBlock(profile_, requesting_frame,
+ permission_type_)) {
+ update_content_setting = true;
+ allowed = false;
raymes 2016/07/28 08:07:50 I think there is a similar problem here. Thankfull
dominickn 2016/08/01 01:08:51 Acknowledged (see my comment above).
+ }
+
// TODO(miguelg): move the permission persistence to
// PermissionContextBase once all the types are moved there.
PermissionRequestGestureType gesture_type =

Powered by Google App Engine
This is Rietveld 408576698