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

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

Issue 2254763002: Enable the optional permission prompt persistence toggle on grouped infobars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-infobardelegate-clean
Patch Set: DCHECK -> CHECK Created 4 years, 3 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/grouped_permission_infobar_delegate.cc
diff --git a/chrome/browser/permissions/grouped_permission_infobar_delegate.cc b/chrome/browser/permissions/grouped_permission_infobar_delegate.cc
index 4e1834f1d728452327fead4284d1bc6279f1d66b..6ea8084bb31673e93eb5b64aec9129488334cd86 100644
--- a/chrome/browser/permissions/grouped_permission_infobar_delegate.cc
+++ b/chrome/browser/permissions/grouped_permission_infobar_delegate.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "chrome/browser/permissions/grouped_permission_infobar_delegate.h"
+#include "chrome/browser/permissions/permission_util.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/url_formatter/elide_url.h"
@@ -13,7 +14,8 @@ GroupedPermissionInfoBarDelegate::GroupedPermissionInfoBarDelegate(
const std::vector<ContentSettingsType>& types)
: requesting_origin_(requesting_origin),
types_(types),
- accept_states_(types_.size(), true) {}
+ accept_states_(types_.size(), true),
+ persist_(true) {}
GroupedPermissionInfoBarDelegate::~GroupedPermissionInfoBarDelegate() {}
@@ -22,6 +24,10 @@ GroupedPermissionInfoBarDelegate::GetInfoBarType() const {
return PAGE_ACTION_TYPE;
}
+bool GroupedPermissionInfoBarDelegate::ShouldShowPersistenceToggle() const {
+ return PermissionUtil::ShouldShowPersistenceToggle();
+}
+
int GroupedPermissionInfoBarDelegate::GetButtons() const {
if (GetPermissionCount() >= 2)
return ConfirmInfoBarDelegate::InfoBarButton::BUTTON_OK;

Powered by Google App Engine
This is Rietveld 408576698