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

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

Issue 2757483002: Move requests from GroupedPermissionInfoBarDelegate to PermissionPromptAndroid (Closed)
Patch Set: rename inline function Created 3 years, 9 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 ba0b531d7b7272eaacc222f16b19b0a0a0dd898a..607b369d1ffb12e17b167edae6c5859d124d7b15 100644
--- a/chrome/browser/permissions/permission_prompt_android.cc
+++ b/chrome/browser/permissions/permission_prompt_android.cc
@@ -39,8 +39,9 @@ void PermissionPromptAndroid::Show(
if (!infobar_service)
return;
- infobar_ = GroupedPermissionInfoBarDelegate::Create(
- this, infobar_service, requests[0]->GetOrigin(), requests);
+ requests_ = requests;
+ infobar_ = GroupedPermissionInfoBarDelegate::Create(this, infobar_service,
+ requests[0]->GetOrigin());
}
bool PermissionPromptAndroid::CanAcceptRequestUpdate() {
@@ -70,6 +71,7 @@ gfx::NativeWindow PermissionPromptAndroid::GetNativeWindow() {
}
void PermissionPromptAndroid::Closing() {
+ requests_.clear();
if (delegate_)
delegate_->Closing();
}
@@ -80,15 +82,34 @@ void PermissionPromptAndroid::ToggleAccept(int index, bool value) {
}
void PermissionPromptAndroid::Accept() {
+ requests_.clear();
if (delegate_)
delegate_->Accept();
}
void PermissionPromptAndroid::Deny() {
+ requests_.clear();
if (delegate_)
delegate_->Deny();
}
+ContentSettingsType PermissionPromptAndroid::GetContentSettingType(
+ size_t position) const {
+ DCHECK_LT(position, requests_.size());
+ return requests_[position]->GetContentSettingsType();
+}
+
+int PermissionPromptAndroid::GetIconIdForPermission(size_t position) const {
+ DCHECK_LT(position, requests_.size());
+ return requests_[position]->GetIconId();
+}
+
+base::string16 PermissionPromptAndroid::GetMessageTextFragment(
+ size_t position) const {
+ DCHECK_LT(position, requests_.size());
+ return requests_[position]->GetMessageTextFragment();
+}
+
// static
std::unique_ptr<PermissionPrompt> PermissionPrompt::Create(
content::WebContents* web_contents) {

Powered by Google App Engine
This is Rietveld 408576698