Index: chrome/browser/ui/android/infobars/grouped_permission_infobar.cc |
diff --git a/chrome/browser/ui/android/infobars/grouped_permission_infobar.cc b/chrome/browser/ui/android/infobars/grouped_permission_infobar.cc |
index 7f8249f65b4032af6dce6a25c9cb8e502ef7ed90..8f3065532a50d09f84d1b1780eb927f965948b60 100644 |
--- a/chrome/browser/ui/android/infobars/grouped_permission_infobar.cc |
+++ b/chrome/browser/ui/android/infobars/grouped_permission_infobar.cc |
@@ -34,6 +34,18 @@ void GroupedPermissionInfoBar::SetPermissionState( |
} |
} |
+void GroupedPermissionInfoBar::ProcessButton(int action) { |
+ // Check if the delegate asked us to display a persistence toggle. If so, |
+ // inform it of the toggle state. |
+ GroupedPermissionInfoBarDelegate* delegate = GetDelegate(); |
+ if (delegate->ShouldShowPersistenceToggle()) { |
+ delegate->set_persist(Java_GroupedPermissionInfoBar_isPersistSwitchOn( |
+ base::android::AttachCurrentThread(), GetJavaInfoBar())); |
+ } |
+ |
+ ConfirmInfoBar::ProcessButton(action); |
+} |
+ |
base::android::ScopedJavaLocalRef<jobject> |
GroupedPermissionInfoBar::CreateRenderInfoBar(JNIEnv* env) { |
GroupedPermissionInfoBarDelegate* delegate = GetDelegate(); |
@@ -64,7 +76,8 @@ GroupedPermissionInfoBar::CreateRenderInfoBar(JNIEnv* env) { |
base::android::ToJavaIntArray(env, permission_icons), |
base::android::ToJavaArrayOfStrings(env, permission_strings), |
GetWindowAndroid(), |
- base::android::ToJavaIntArray(env, content_settings_types)); |
+ base::android::ToJavaIntArray(env, content_settings_types), |
+ delegate->ShouldShowPersistenceToggle()); |
} |
void GroupedPermissionInfoBar::SetJavaInfoBar( |