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

Unified Diff: chrome/browser/permissions/permission_infobar_delegate.h

Issue 2226633002: Add a feature to display a persistence toggle for permission prompts on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/permissions/permission_infobar_delegate.h
diff --git a/chrome/browser/permissions/permission_infobar_delegate.h b/chrome/browser/permissions/permission_infobar_delegate.h
index a605229d6f487d4658f1584b1ebe1b051b3b7fbc..0e09bab078e503c4409041faf1e98af619acd6ec 100644
--- a/chrome/browser/permissions/permission_infobar_delegate.h
+++ b/chrome/browser/permissions/permission_infobar_delegate.h
@@ -25,6 +25,14 @@ class PermissionInfobarDelegate : public ConfirmInfoBarDelegate {
using PermissionSetCallback = base::Callback<void(bool, bool)>;
ContentSettingsType content_setting() const { return content_settings_type_; }
+ // Returns true if the infobar should display a toggle to allow users to
+ // opt-out of persisting their accept/deny decision.
+ bool ShouldShowPersistenceToggle() const;
+
+ // Sets whether or not a decided permission should be persisted to content
+ // settings.
+ void SetPersist(bool persist) { persist_ = persist; }
+
protected:
PermissionInfobarDelegate(const GURL& requesting_origin,
content::PermissionType permission_type,
@@ -49,12 +57,13 @@ class PermissionInfobarDelegate : public ConfirmInfoBarDelegate {
void SetPermission(bool update_content_setting, bool allowed);
GURL requesting_origin_;
- bool action_taken_;
content::PermissionType permission_type_;
ContentSettingsType content_settings_type_;
- bool user_gesture_;
Profile* const profile_;
const PermissionSetCallback callback_;
+ bool action_taken_;
+ bool user_gesture_;
+ bool persist_;
DISALLOW_COPY_AND_ASSIGN(PermissionInfobarDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698