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

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

Issue 2440403002: Make GroupedPermissionInfoBarDelegate's methods call through PermissionPromptAndroid (Closed)
Patch Set: add set and reset 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_prompt_android.cc
diff --git a/chrome/browser/permissions/permission_prompt_android.cc b/chrome/browser/permissions/permission_prompt_android.cc
index 19631a2c5131df989b5444694d33c0aef4714ee3..3afb3d9c7f0e281303b7fc592994abae14b582a5 100644
--- a/chrome/browser/permissions/permission_prompt_android.cc
+++ b/chrome/browser/permissions/permission_prompt_android.cc
@@ -35,6 +35,10 @@ void PermissionPromptAndroid::Show(
infobar_ = GroupedPermissionInfoBarDelegate::Create(
infobar_service, requests[0]->GetOrigin(), requests);
+
+ GroupedPermissionInfoBarDelegate* infobar_delegate =
+ infobar_->delegate()->AsGroupedPermissionInfoBarDelegate();
+ infobar_delegate->SetPermissionPrompt(this);
raymes 2016/11/01 00:07:46 Now that I look at it, I think passing this pointe
lshang 2016/11/01 04:33:42 Done.
}
bool PermissionPromptAndroid::CanAcceptRequestUpdate() {
@@ -47,6 +51,9 @@ void PermissionPromptAndroid::Hide() {
if (infobar_ && infobar_service) {
infobar_service->RemoveInfoBar(infobar_);
}
+ GroupedPermissionInfoBarDelegate* infobar_delegate =
+ infobar_->delegate()->AsGroupedPermissionInfoBarDelegate();
raymes 2016/11/01 00:07:46 I don't think we need to add this function, I thin
lshang 2016/11/01 04:33:42 Refer to other infobars, the convention seems to u
raymes 2016/11/01 05:29:15 If you know the type ahead of time (which I think
+ infobar_delegate->ResetPermissionPrompt();
raymes 2016/11/01 00:07:46 Maybe this should just go in the destructor of thi
lshang 2016/11/01 04:33:42 Done.
infobar_ = nullptr;
}
@@ -69,6 +76,16 @@ void PermissionPromptAndroid::Closing() {
delegate_->Closing();
}
+void PermissionPromptAndroid::Accept() {
+ if (delegate_)
+ delegate_->Accept();
+}
+
+void PermissionPromptAndroid::Deny() {
+ if (delegate_)
+ delegate_->Deny();
+}
+
// static
std::unique_ptr<PermissionPrompt> PermissionPrompt::Create(
content::WebContents* web_contents) {

Powered by Google App Engine
This is Rietveld 408576698