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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java

Issue 2081533002: Edit contacts UI for PaymentRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@contactDetails
Patch Set: Addressed comments Created 4 years, 6 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/payments/ui/SectionInformation.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java
index ff95deffed18a64ff83ea7921a4abd5c342af9cc..14e6909f497ff56420ee29f179d020230332914d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java
@@ -28,7 +28,7 @@ public class SectionInformation {
public static final int INVALID_SELECTION = -2;
@PaymentRequestUI.DataType private final int mDataType;
- private final ArrayList<PaymentOption> mItems;
+ private ArrayList<PaymentOption> mItems;
private int mSelectedItem;
/**
@@ -148,6 +148,17 @@ public class SectionInformation {
}
/**
+ * Adds the given item at the head of the list and selects it.
+ *
+ * @param item The item to add.
+ */
+ public void addAndSelectItem(PaymentOption item) {
+ if (mItems == null) mItems = new ArrayList<>();
+ mItems.add(0, item);
+ mSelectedItem = 0;
+ }
+
+ /**
* Returns the resource ID for the string telling users that they can add a new option.
*
* @return ID if the user can add a new option, or 0 if they can't.

Powered by Google App Engine
This is Rietveld 408576698