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

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

Issue 2446063002: Implement a modal permission dialog on Android gated by a feature. (Closed)
Patch Set: Allow user gesture requirement to be overridden by variations Created 4 years, 2 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 6f2ef7940e4fbb74d9dbe71907d94e420fe53481..f2ea4b4970c68192503e08e33cabc803f34fd6d9 100644
--- a/chrome/browser/permissions/permission_infobar_delegate.h
+++ b/chrome/browser/permissions/permission_infobar_delegate.h
@@ -23,12 +23,17 @@ class InfoBar;
class InfoBarService;
class Profile;
-// Base class for permission infobars, it implements the default behavior
-// so that the accept/deny buttons grant/deny the relevant permission.
-// A basic implementor only needs to implement the methods that
+// Base delegate class for permission prompts on Android. The default behavior
+// is that the accept/deny buttons grant/deny the relevant permission
+// respectively. A basic implementor only needs to implement the methods that
// provide an icon and a message text to the infobar.
+//
+// By default, the user is presented with an infobar to make their choice. If
+// the experimental ModalPermissionPrompts feature is active, they will instead
+// see a modal dialog. Currently, this class is used for both; future
+// refactoring will be undertaken based on whether support for infobars is
+// retained following the modal prompt experiment.
class PermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
-
public:
using PermissionSetCallback = base::Callback<void(bool, PermissionAction)>;
@@ -55,6 +60,10 @@ class PermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
bool persist() const { return persist_; }
// ConfirmInfoBarDelegate:
+ bool Accept() override;
+ bool Cancel() override;
+ void InfoBarDismissed() override;
+ base::string16 GetButtonLabel(InfoBarButton button) const override;
base::string16 GetMessageText() const override;
protected:
@@ -68,11 +77,7 @@ class PermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
private:
// ConfirmInfoBarDelegate:
Type GetInfoBarType() const override;
- void InfoBarDismissed() override;
PermissionInfoBarDelegate* AsPermissionInfoBarDelegate() override;
- base::string16 GetButtonLabel(InfoBarButton button) const override;
- bool Accept() override;
- bool Cancel() override;
virtual int GetMessageResourceId() const = 0;
void SetPermission(bool update_content_setting, PermissionAction decision);

Powered by Google App Engine
This is Rietveld 408576698