OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.payments.ui; |
| 6 |
| 7 /** The data to show in a shipping summary section. It contains shipping address
and option. */ |
| 8 public class ShippingSummaryInformation { |
| 9 private SectionInformation mShippingAddress; |
| 10 private SectionInformation mShippingOption; |
| 11 |
| 12 /** Builds ShppingSummaryInformation with shipping address and option sectio
n information. */ |
| 13 public ShippingSummaryInformation( |
| 14 SectionInformation shippingAddress, SectionInformation shippingOptio
n) { |
| 15 mShippingAddress = shippingAddress; |
| 16 mShippingOption = shippingOption; |
| 17 } |
| 18 |
| 19 /** |
| 20 * Returns the label for the selected shipping address. |
| 21 * |
| 22 * @return The label for the selected shipping address or null. |
| 23 */ |
| 24 public String getSelectedShippingAddressLabel() { |
| 25 PaymentOption address = mShippingAddress.getSelectedItem(); |
| 26 return address != null ? address.getLabel() : null; |
| 27 } |
| 28 |
| 29 /** |
| 30 * Returns the sublabel for the selected shipping address. |
| 31 * |
| 32 * @return The sublabel for the selected shipping address or null. |
| 33 */ |
| 34 public String getSelectedShippingAddressSublabel() { |
| 35 PaymentOption address = mShippingAddress.getSelectedItem(); |
| 36 return address != null ? address.getSublabel() : null; |
| 37 } |
| 38 |
| 39 /** |
| 40 * Returns the tertiary label for the selected shipping address. |
| 41 * |
| 42 * @return The tertiary label for the selected shipping address or null. |
| 43 */ |
| 44 public String getSelectedShippingAddressTertiaryLabel() { |
| 45 PaymentOption address = mShippingAddress.getSelectedItem(); |
| 46 return address != null ? address.getTertiaryLabel() : null; |
| 47 } |
| 48 |
| 49 /** |
| 50 * Returns the label for the selected shipping option. |
| 51 * |
| 52 * @return The label for the selected shipping option or null. |
| 53 */ |
| 54 public String getSelectedShippingOptionLabel() { |
| 55 PaymentOption option = mShippingOption.getSelectedItem(); |
| 56 return option != null ? option.getLabel() : null; |
| 57 } |
| 58 |
| 59 public SectionInformation getShippingAddressSectionInfo() { |
| 60 return mShippingAddress; |
| 61 } |
| 62 } |
OLD | NEW |