| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
|
| index 638df3af6b830eaec5863b4b8fd173961a82a9d2..87f577485d3a764192562234d354d47cf594bd75 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
|
| @@ -16,22 +16,27 @@ public class PaymentOption {
|
|
|
| private final String mId;
|
| private final int mIcon;
|
| - @Nullable private String mLabel;
|
| - @Nullable private String mSublabel;
|
| + private String[] mLabels = {null, null, null};
|
| private boolean mIsValid = true;
|
|
|
| + /** See {@link #PaymentOption(String, String, String, String, int)}. */
|
| + public PaymentOption(String id, @Nullable String label, @Nullable String sublabel, int icon) {
|
| + this(id, label, sublabel, null, icon);
|
| + }
|
| +
|
| /**
|
| * Constructs a payment option.
|
| *
|
| - * @param id The identifier.
|
| - * @param label The label.
|
| - * @param sublabel The optional sublabel.
|
| - * @param icon The drawable icon identifier or NO_ICON.
|
| + * @param id The identifier.
|
| + * @param label The label.
|
| + * @param sublabel The optional sublabel.
|
| + * @param tertiarylabel The optional tertiary label.
|
| + * @param icon The drawable icon identifier or NO_ICON.
|
| */
|
| - public PaymentOption(String id, @Nullable String label, @Nullable String sublabel, int icon) {
|
| + public PaymentOption(String id, @Nullable String label, @Nullable String sublabel,
|
| + @Nullable String tertiarylabel, int icon) {
|
| mId = id;
|
| - mLabel = label;
|
| - mSublabel = sublabel;
|
| + updateLabels(label, sublabel, tertiarylabel);
|
| mIcon = icon;
|
| }
|
|
|
| @@ -47,25 +52,40 @@ public class PaymentOption {
|
| * The primary label of this option. For example, “Visa***1234” or "2-day shipping".
|
| */
|
| @Nullable public String getLabel() {
|
| - return mLabel;
|
| + return mLabels[0];
|
| }
|
|
|
| /**
|
| * The optional sublabel of this option. For example, “Expiration date: 12/2025”.
|
| */
|
| @Nullable public String getSublabel() {
|
| - return mSublabel;
|
| + return mLabels[1];
|
| }
|
|
|
| /**
|
| - * Updates the label and sublabel of this option. Called after the user has edited this option.
|
| - *
|
| - * @param label The new label to use. Should not be null.
|
| - * @param sublabel The new sublabel to use. Can be null.
|
| + * The optional tertiary label of this option. For example, "(555) 867-5309".
|
| */
|
| + @Nullable public String getTertiaryLabel() {
|
| + return mLabels[2];
|
| + }
|
| +
|
| + /** See {@link #updateLabels(String, String, String)}). */
|
| protected void updateLabels(String label, @Nullable String sublabel) {
|
| - mLabel = label;
|
| - mSublabel = sublabel;
|
| + updateLabels(label, sublabel, null);
|
| + }
|
| +
|
| + /**
|
| + * Updates the labels of this option. Called after the user has edited this option.
|
| + *
|
| + * @param label The new label to use. Should not be null.
|
| + * @param sublabel The new sublabel to use. Can be null.
|
| + * @param tertiarylabel The new tertiary label to use. Can be null.
|
| + */
|
| + protected void updateLabels(
|
| + String label, @Nullable String sublabel, @Nullable String tertiarylabel) {
|
| + mLabels[0] = label;
|
| + mLabels[1] = sublabel;
|
| + mLabels[2] = tertiarylabel;
|
| }
|
|
|
| /**
|
|
|