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

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

Issue 2440403002: Make GroupedPermissionInfoBarDelegate's methods call through PermissionPromptAndroid (Closed)
Patch Set: address 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/grouped_permission_infobar_delegate_android.h
diff --git a/chrome/browser/permissions/grouped_permission_infobar_delegate_android.h b/chrome/browser/permissions/grouped_permission_infobar_delegate_android.h
index 7971869757fd362371073c7d363027e8ca91e438..cc427208d8a16f219fb1712d4fb26e4c9d692c62 100644
--- a/chrome/browser/permissions/grouped_permission_infobar_delegate_android.h
+++ b/chrome/browser/permissions/grouped_permission_infobar_delegate_android.h
@@ -13,6 +13,7 @@
class GURL;
class InfoBarService;
+class PermissionPromptAndroid;
class PermissionRequest;
// An InfoBar that displays a group of permission requests, each of which can be
@@ -24,6 +25,7 @@ class GroupedPermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
~GroupedPermissionInfoBarDelegate() override;
static infobars::InfoBar* Create(
+ PermissionPromptAndroid* permission_prompt,
InfoBarService* infobar_service,
const GURL& requesting_origin,
const std::vector<PermissionRequest*>& requests);
@@ -47,6 +49,8 @@ class GroupedPermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
// ConfirmInfoBarDelegate:
base::string16 GetMessageText() const override;
+ bool Accept() override;
+ bool Cancel() override;
protected:
bool GetAcceptState(size_t position);
@@ -54,7 +58,8 @@ class GroupedPermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
private:
GroupedPermissionInfoBarDelegate(
const GURL& requesting_origin,
- const std::vector<PermissionRequest*>& requests);
+ const std::vector<PermissionRequest*>& requests,
+ PermissionPromptAndroid* permission_prompt);
// ConfirmInfoBarDelegate:
InfoBarIdentifier GetIdentifier() const override;
@@ -67,6 +72,9 @@ class GroupedPermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
std::vector<bool> accept_states_;
// Whether the accept/deny decision is persisted.
bool persist_;
+ // PermissionPromptAndroid's lifetime matches that of this object as it
+ // controls the lifetime of the infobar which we are a delegate to.
raymes 2016/10/27 01:32:33 Hmm - it's not immediately clear to me that the Pe
lshang 2016/10/28 03:18:48 I think your point makes sense, that's a tricky on
+ PermissionPromptAndroid* permission_prompt_;
DISALLOW_COPY_AND_ASSIGN(GroupedPermissionInfoBarDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698