Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShippingSummaryInformation.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShippingSummaryInformation.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShippingSummaryInformation.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a4fe23f8d0f97ebca6114e23b0ed2b5ce65960ec |
--- /dev/null |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShippingSummaryInformation.java |
@@ -0,0 +1,62 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.chrome.browser.payments.ui; |
+ |
+/** The data to show in a shipping summary section. It contains shipping address and option. */ |
+public class ShippingSummaryInformation { |
+ private SectionInformation mShippingAddress; |
+ private SectionInformation mShippingOption; |
+ |
+ /** Builds ShppingSummaryInformation with shipping address and option section information. */ |
+ public ShippingSummaryInformation( |
+ SectionInformation shippingAddress, SectionInformation shippingOption) { |
+ mShippingAddress = shippingAddress; |
+ mShippingOption = shippingOption; |
+ } |
+ |
+ /** |
+ * Returns the label for the selected shipping address. |
+ * |
+ * @return The label for the selected shipping address or null. |
+ */ |
+ public String getSelectedShippingAddressLabel() { |
+ PaymentOption address = mShippingAddress.getSelectedItem(); |
+ return address != null ? address.getLabel() : null; |
+ } |
+ |
+ /** |
+ * Returns the sublabel for the selected shipping address. |
+ * |
+ * @return The sublabel for the selected shipping address or null. |
+ */ |
+ public String getSelectedShippingAddressSublabel() { |
+ PaymentOption address = mShippingAddress.getSelectedItem(); |
+ return address != null ? address.getSublabel() : null; |
+ } |
+ |
+ /** |
+ * Returns the tertiary label for the selected shipping address. |
+ * |
+ * @return The tertiary label for the selected shipping address or null. |
+ */ |
+ public String getSelectedShippingAddressTertiaryLabel() { |
+ PaymentOption address = mShippingAddress.getSelectedItem(); |
+ return address != null ? address.getTertiaryLabel() : null; |
+ } |
+ |
+ /** |
+ * Returns the label for the selected shipping option. |
+ * |
+ * @return The label for the selected shipping option or null. |
+ */ |
+ public String getSelectedShippingOptionLabel() { |
+ PaymentOption option = mShippingOption.getSelectedItem(); |
+ return option != null ? option.getLabel() : null; |
+ } |
+ |
+ public SectionInformation getShippingAddressSectionInfo() { |
+ return mShippingAddress; |
+ } |
+} |