Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBarDelegate.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBarDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBarDelegate.java |
index 5ca37089c53f768cc5e472590447e5c301405e2e..0c163d5cefc3922b8011a95adb5d67cea5e4c066 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBarDelegate.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBarDelegate.java |
@@ -10,11 +10,16 @@ import org.chromium.base.annotations.CalledByNative; |
import org.chromium.chrome.browser.ResourceId; |
import org.chromium.ui.base.WindowAndroid; |
+import java.util.LinkedList; |
+ |
/** |
* Provides JNI methods for ConfirmInfoBars |
*/ |
public class ConfirmInfoBarDelegate { |
+ LinkedList<InfoBar.Detail> mDetails = new LinkedList<InfoBar.Detail>(); |
+ LinkedList<InfoBar.Description> mDescriptions = new LinkedList<InfoBar.Description>(); |
+ |
private ConfirmInfoBarDelegate() { |
} |
@@ -23,6 +28,33 @@ public class ConfirmInfoBarDelegate { |
return new ConfirmInfoBarDelegate(); |
} |
+ |
+ @CalledByNative |
+ void addDetail(int enumeratedIconId, String label, String subLabel) { |
+ InfoBar.Detail detail = new InfoBar.Detail(); |
+ detail.iconDrawableId = ResourceId.mapToDrawableId(enumeratedIconId); |
+ detail.label = label; |
+ detail.subLabel = subLabel; |
+ mDetails.add(detail); |
+ } |
+ |
+ @CalledByNative |
+ void addDescription(String text) { |
+ InfoBar.Description description = new InfoBar.Description(); |
+ description.text = text; |
+ description.links = new LinkedList<InfoBar.Description.Link>(); |
+ mDescriptions.add(description); |
+ } |
+ |
+ @CalledByNative |
+ void addLinkToLastDescription(int start, int end, String url) { |
+ InfoBar.Description.Link link = new InfoBar.Description.Link(); |
+ link.start = start; |
+ link.end = end; |
+ link.url = url; |
+ mDescriptions.getLast().links.add(link); |
+ } |
+ |
/** |
* Creates and begins the process for showing a ConfirmInfoBar. |
* @param windowAndroid The owning window for the infobar. |
@@ -46,6 +78,8 @@ public class ConfirmInfoBarDelegate { |
ConfirmInfoBar infoBar = new ConfirmInfoBar( |
null, drawableId, iconBitmap, message, linkText, buttonOk, buttonCancel); |
infoBar.setContentSettings(windowAndroid, contentSettings); |
+ infoBar.setDetails(mDetails); |
+ infoBar.setDescriptions(mDescriptions); |
return infoBar; |
} |