Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/GroupedPermissionInfoBar.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/GroupedPermissionInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/GroupedPermissionInfoBar.java |
index 8ccf47b891d4b62635340dd4d47950cd8523ba3a..1b869b8fe8c7c5b1f4a76cd23b3a7e2f74d90613 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/GroupedPermissionInfoBar.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/GroupedPermissionInfoBar.java |
@@ -27,8 +27,8 @@ public class GroupedPermissionInfoBar extends PermissionInfoBar { |
GroupedPermissionInfoBar(String message, String buttonOk, String buttonCancel, |
int[] permissionIcons, String[] permissionText, WindowAndroid windowAndroid, |
- int[] contentSettings) { |
- super(0, null, message, null, buttonOk, buttonCancel); |
+ int[] contentSettings, boolean showPersistenceToggle) { |
+ super(0, null, message, null, buttonOk, buttonCancel, showPersistenceToggle); |
mPermissionIcons = permissionIcons; |
mPermissionText = permissionText; |
mWindowAndroid = windowAndroid; |
@@ -37,7 +37,6 @@ public class GroupedPermissionInfoBar extends PermissionInfoBar { |
@Override |
public void createContent(InfoBarLayout layout) { |
- super.createContent(layout); |
InfoBarControlLayout control = layout.addControlLayout(); |
if (mPermissionIcons.length == 1) { |
@@ -49,6 +48,9 @@ public class GroupedPermissionInfoBar extends PermissionInfoBar { |
R.color.light_normal_color, mPermissionText[i], i, true); |
} |
} |
+ |
+ // Call this last to ensure that if a persistence toggle is added, it's added last. |
+ super.createContent(layout); |
} |
@Override |
@@ -90,6 +92,11 @@ public class GroupedPermissionInfoBar extends PermissionInfoBar { |
super.onButtonClicked(isPrimaryButton); |
} |
+ @CalledByNative |
+ protected boolean isPersistSwitchOn() { |
+ return super.isPersistSwitchOn(); |
+ } |
+ |
/** |
* Create an infobar for a given set of permission requests. |
* |
@@ -101,13 +108,16 @@ public class GroupedPermissionInfoBar extends PermissionInfoBar { |
* @param permissionText String to display for each permission request. |
* @param windowAndroid The window which owns the infobar. |
* @param contentSettings The list of ContentSettingsTypes requested by the infobar. |
+ * @param showPersistenceToggle Whether or not a toggle to opt-out of persisting a decision |
+ * should be displayed. |
*/ |
@CalledByNative |
private static InfoBar create(String message, String buttonOk, String buttonCancel, |
int[] permissionIcons, String[] permissionText, WindowAndroid windowAndroid, |
- int[] contentSettings) { |
- GroupedPermissionInfoBar infobar = new GroupedPermissionInfoBar(message, buttonOk, |
- buttonCancel, permissionIcons, permissionText, windowAndroid, contentSettings); |
+ int[] contentSettings, boolean showPersistenceToggle) { |
+ GroupedPermissionInfoBar infobar = |
+ new GroupedPermissionInfoBar(message, buttonOk, buttonCancel, permissionIcons, |
+ permissionText, windowAndroid, contentSettings, showPersistenceToggle); |
return infobar; |
} |