Chromium Code Reviews| 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..d8f77a458a7073d7d227442815e5787febb56dba 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,15 @@ public class SectionInformation { |
| } |
| /** |
| + * Adds and selects the given item. |
|
gone
2016/06/21 06:04:39
Indicate that it's added at the head of the list.
please use gerrit instead
2016/06/22 02:12:31
Done.
|
| + */ |
| + 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. |