Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java |
index 1762e30aa0cd1cd0fde8421b8555a188e207ee33..06b96190c33b04f15504340f35089695ba46e35b 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java |
@@ -42,10 +42,11 @@ public class PermissionInfoBar extends ConfirmInfoBar { |
private SparseArray<String> mContentSettingsToPermissionsMap; |
protected PermissionInfoBar(int iconDrawableId, Bitmap iconBitmap, String message, |
- String linkText, String primaryButtonText, String secondaryButtonText) { |
+ String linkText, String primaryButtonText, String secondaryButtonText, |
+ boolean showPersistenceToggle) { |
super(iconDrawableId, iconBitmap, message, linkText, primaryButtonText, |
secondaryButtonText); |
- mShowPersistenceToggle = false; |
+ mShowPersistenceToggle = showPersistenceToggle; |
} |
@Override |
@@ -83,16 +84,6 @@ public class PermissionInfoBar extends ConfirmInfoBar { |
mContentSettingsToPermissionsMap = generatePermissionsMapping(contentSettings); |
} |
- /** |
- * Specifies whether or not this infobar should display a toggle asking the user if they want to |
- * save their choice. |
- * |
- * @param showPersistenceToggle True if the toggle should be displayed. |
- */ |
- private void setShowPersistenceToggle(boolean showPersistenceToggle) { |
- mShowPersistenceToggle = showPersistenceToggle; |
- } |
- |
private SparseArray<String> generatePermissionsMapping(int[] contentSettings) { |
SparseArray<String> permissionsToRequest = new SparseArray<String>(); |
for (int i = 0; i < contentSettings.length; i++) { |
@@ -210,7 +201,7 @@ public class PermissionInfoBar extends ConfirmInfoBar { |
* Returns true if the persist switch exists and is toggled on. |
*/ |
@CalledByNative |
- private boolean isPersistSwitchOn() { |
+ protected boolean isPersistSwitchOn() { |
SwitchCompat persistSwitch = (SwitchCompat) getView().findViewById( |
R.id.permission_infobar_persist_toggle); |
if (mShowPersistenceToggle && persistSwitch != null) { |
@@ -242,9 +233,8 @@ public class PermissionInfoBar extends ConfirmInfoBar { |
int drawableId = ResourceId.mapToDrawableId(enumeratedIconId); |
PermissionInfoBar infoBar = new PermissionInfoBar(drawableId, iconBitmap, message, linkText, |
- buttonOk, buttonCancel); |
+ buttonOk, buttonCancel, showPersistenceToggle); |
infoBar.setContentSettings(windowAndroid, contentSettings); |
- infoBar.setShowPersistenceToggle(showPersistenceToggle); |
return infoBar; |
} |