Chromium Code Reviews| 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..ff93e2ed130cad5638f78e45d262341fa3636c9c |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShippingSummaryInformation.java |
| @@ -0,0 +1,67 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
please use gerrit instead
2017/03/27 20:28:31
Either upload with --similarity=10 (which tries ha
gogerald1
2017/03/27 23:26:47
Done.
|
| +// 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. |
| + */ |
|
gone
2017/03/28 00:20:39
@Nullable here and everywhere appropriate below
gogerald1
2017/03/28 18:46:24
Done.
|
| + 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; |
| + } |
| + |
| + /** |
| + * Returns the shipping address section information. |
| + * |
| + * @return The shipping address section information. |
| + */ |
| + public SectionInformation getShippingAddressSectionInfo() { |
| + return mShippingAddress; |
| + } |
| +} |