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

Side by Side Diff: chrome/browser/permissions/permission_infobar_delegate.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: Addressing nits Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "chrome/browser/permissions/permission_infobar_delegate.h" 5 #include "chrome/browser/permissions/permission_infobar_delegate.h"
6 6
7 #include "chrome/browser/permissions/permission_decision_auto_blocker.h"
7 #include "chrome/browser/permissions/permission_request.h" 8 #include "chrome/browser/permissions/permission_request.h"
8 #include "chrome/browser/permissions/permission_uma_util.h" 9 #include "chrome/browser/permissions/permission_uma_util.h"
9 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
10 #include "components/infobars/core/infobar.h" 11 #include "components/infobars/core/infobar.h"
11 #include "components/url_formatter/elide_url.h" 12 #include "components/url_formatter/elide_url.h"
12 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
13 14
14 PermissionInfobarDelegate::~PermissionInfobarDelegate() { 15 PermissionInfobarDelegate::~PermissionInfobarDelegate() {
15 if (!action_taken_) { 16 if (!action_taken_) {
17 PermissionDecisionAutoBlocker(profile_).RecordIgnore(requesting_origin_,
18 permission_type_);
19
16 PermissionUmaUtil::PermissionIgnored( 20 PermissionUmaUtil::PermissionIgnored(
17 permission_type_, 21 permission_type_,
18 user_gesture_ ? PermissionRequestGestureType::GESTURE 22 user_gesture_ ? PermissionRequestGestureType::GESTURE
19 : PermissionRequestGestureType::NO_GESTURE, 23 : PermissionRequestGestureType::NO_GESTURE,
20 requesting_origin_, profile_); 24 requesting_origin_, profile_);
21 } 25 }
22 } 26 }
23 27
24 PermissionInfobarDelegate::PermissionInfobarDelegate( 28 PermissionInfobarDelegate::PermissionInfobarDelegate(
25 const GURL& requesting_origin, 29 const GURL& requesting_origin,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 bool PermissionInfobarDelegate::Cancel() { 76 bool PermissionInfobarDelegate::Cancel() {
73 SetPermission(true, false); 77 SetPermission(true, false);
74 return true; 78 return true;
75 } 79 }
76 80
77 void PermissionInfobarDelegate::SetPermission(bool update_content_setting, 81 void PermissionInfobarDelegate::SetPermission(bool update_content_setting,
78 bool allowed) { 82 bool allowed) {
79 action_taken_ = true; 83 action_taken_ = true;
80 callback_.Run(update_content_setting, allowed); 84 callback_.Run(update_content_setting, allowed);
81 } 85 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698