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

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

Issue 1904553003: Java implementation of PaymentRequest mojo service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 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 df8e9d51e8892945a7d3be933d8d91e4d61a6d6c..e4aa1152d692564b90fda1031f5ae1ecd8ed330d 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
@@ -90,7 +90,7 @@ public class SectionInformation {
}
/**
- * Sets the currently selected item.
+ * Sets the currently selected item by index.
*
* @param index The index of the currently selected item, or NO_SELECTION if a selection has not
* yet been made.
@@ -100,6 +100,22 @@ public class SectionInformation {
}
/**
+ * Sets the currently selected item.
+ *
+ * @param selectedItem The currently selected item, or null of a selection has not yet been
+ * made.
+ */
+ public void setSelectedItem(PaymentOption selectedItem) {
+ if (mItems == null) return;
+ for (int i = 0; i < mItems.size(); i++) {
+ if (mItems.get(i) == selectedItem) {
+ mSelectedItem = i;
+ return;
+ }
+ }
+ }
+
+ /**
* Returns the index of the selected item.
*
* @return The index of the currently selected item, or NO_SELECTION if a selection has not yet
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698