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

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

Issue 2026353002: [Autofill] Credit Card Assist Infobar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleaning Created 4 years, 4 months 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/AutofillSaveCardInfoBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/AutofillSaveCardInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/AutofillSaveCardInfoBar.java
index d4d09b5d5cb8e717652208b620f89a20fc09fbf1..151a58d8b5d238b9a8b647006da9b7af28c5cc42 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/AutofillSaveCardInfoBar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/AutofillSaveCardInfoBar.java
@@ -13,6 +13,7 @@ import android.view.View;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.chrome.browser.ResourceId;
+import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -21,41 +22,6 @@ import java.util.List;
*/
public class AutofillSaveCardInfoBar extends ConfirmInfoBar {
/**
- * Detailed card information to show in the infobar.
- */
- public static class CardDetail {
- /**
- * The identifier of the drawable of the card issuer icon.
- */
- public int issuerIconDrawableId;
-
- /**
- * The label for the card.
- */
- public String label;
-
- /**
- * The sub-label for the card.
- */
- public String subLabel;
-
- /**
- * Creates a new instance of the detailed card information.
- *
- * @param enumeratedIconId ID corresponding to the icon that will be shown for this credit
- * card. The ID must have been mapped using the ResourceMapper class
- * before passing it to this function.
- * @param label The credit card label, for example "***1234".
- * @param subLabel The credit card sub-label, for example "Exp: 06/17".
- */
- public CardDetail(int enumeratedIconId, String label, String subLabel) {
- this.issuerIconDrawableId = ResourceId.mapToDrawableId(enumeratedIconId);
- this.label = label;
- this.subLabel = subLabel;
- }
- }
-
- /**
* Legal message line with links to show in the infobar.
*/
public static class LegalMessageLine {
@@ -113,7 +79,7 @@ public class AutofillSaveCardInfoBar extends ConfirmInfoBar {
}
private final long mNativeAutofillSaveCardInfoBar;
- private final List<CardDetail> mCardDetails = new LinkedList<CardDetail>();
+ private final List<CardDetail> mCardDetails = new ArrayList<>();
private final LinkedList<LegalMessageLine> mLegalMessageLines =
new LinkedList<LegalMessageLine>();
@@ -200,7 +166,8 @@ public class AutofillSaveCardInfoBar extends ConfirmInfoBar {
public void createContent(InfoBarLayout layout) {
super.createContent(layout);
InfoBarControlLayout control = layout.addControlLayout();
- for (CardDetail detail : mCardDetails) {
+ for (int i = 0; i < mCardDetails.size(); i++) {
+ CardDetail detail = mCardDetails.get(i);
control.addIcon(detail.issuerIconDrawableId, 0, detail.label, detail.subLabel);
}

Powered by Google App Engine
This is Rietveld 408576698