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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBarDelegate.java

Issue 1540423004: Add card details and legal message to Android save credit card infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial draft Created 5 years 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698