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

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

Issue 2766413003: test (Closed)
Patch Set: format Created 3 years, 9 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/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;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698