| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.payments.ui; | 5 package org.chromium.chrome.browser.payments.ui; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The data to show in the PaymentRequest UI. | 8 * The data to show in the PaymentRequest UI. |
| 9 */ | 9 */ |
| 10 public class PaymentInformation { | 10 public class PaymentInformation { |
| 11 private final ShoppingCart mShoppingCart; | 11 private final ShoppingCart mShoppingCart; |
| 12 private final SectionInformation mShippingAddresses; | 12 private final SectionInformation mShippingAddresses; |
| 13 private final SectionInformation mShippingOptions; | 13 private final SectionInformation mShippingOptions; |
| 14 private final SectionInformation mContactDetails; | 14 private final SectionInformation mPayerInfoDetails; |
| 15 private final SectionInformation mPaymentMethods; | 15 private final SectionInformation mPaymentMethods; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Builds the payment information to show in the PaymentRequest view. | 18 * Builds the payment information to show in the PaymentRequest view. |
| 19 * | 19 * |
| 20 * @param shoppingCart The shopping cart. | 20 * @param shoppingCart The shopping cart. |
| 21 * @param shippingAddresses The shipping addresses. | 21 * @param shippingAddresses The shipping addresses. |
| 22 * @param shippingOptions The shipping options. | 22 * @param shippingOptions The shipping options. |
| 23 * @param contactDetails The contact details. | 23 * @param payerInfoDetails The payer information details. |
| 24 * @param paymentMethods The payment methods. | 24 * @param paymentMethods The payment methods. |
| 25 */ | 25 */ |
| 26 public PaymentInformation(ShoppingCart shoppingCart, SectionInformation ship
pingAddresses, | 26 public PaymentInformation(ShoppingCart shoppingCart, SectionInformation ship
pingAddresses, |
| 27 SectionInformation shippingOptions, SectionInformation contactDetail
s, | 27 SectionInformation shippingOptions, SectionInformation payerInfoDeta
ils, |
| 28 SectionInformation paymentMethods) { | 28 SectionInformation paymentMethods) { |
| 29 mShoppingCart = shoppingCart; | 29 mShoppingCart = shoppingCart; |
| 30 mShippingAddresses = shippingAddresses; | 30 mShippingAddresses = shippingAddresses; |
| 31 mShippingOptions = shippingOptions; | 31 mShippingOptions = shippingOptions; |
| 32 mContactDetails = contactDetails; | 32 mPayerInfoDetails = payerInfoDetails; |
| 33 mPaymentMethods = paymentMethods; | 33 mPaymentMethods = paymentMethods; |
| 34 } | 34 } |
| 35 | 35 |
| 36 /** | 36 /** |
| 37 * Returns the shopping cart. | 37 * Returns the shopping cart. |
| 38 * | 38 * |
| 39 * @return The shopping cart. | 39 * @return The shopping cart. |
| 40 */ | 40 */ |
| 41 public ShoppingCart getShoppingCart() { | 41 public ShoppingCart getShoppingCart() { |
| 42 return mShoppingCart; | 42 return mShoppingCart; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 * Returns the label for the selected shipping option. | 84 * Returns the label for the selected shipping option. |
| 85 * | 85 * |
| 86 * @return The label for the selected shipping option or null. | 86 * @return The label for the selected shipping option or null. |
| 87 */ | 87 */ |
| 88 public String getSelectedShippingOptionLabel() { | 88 public String getSelectedShippingOptionLabel() { |
| 89 PaymentOption option = mShippingOptions.getSelectedItem(); | 89 PaymentOption option = mShippingOptions.getSelectedItem(); |
| 90 return option != null ? option.getLabel() : null; | 90 return option != null ? option.getLabel() : null; |
| 91 } | 91 } |
| 92 | 92 |
| 93 /** | 93 /** |
| 94 * Returns the contact details. | 94 * Returns the payer information details. |
| 95 * | 95 * |
| 96 * @return The contact details. | 96 * @return The payer information details. |
| 97 */ | 97 */ |
| 98 public SectionInformation getContactDetails() { | 98 public SectionInformation getPayerInfoDetails() { |
| 99 return mContactDetails; | 99 return mPayerInfoDetails; |
| 100 } | 100 } |
| 101 | 101 |
| 102 /** | 102 /** |
| 103 * Returns the payment methods. | 103 * Returns the payment methods. |
| 104 * | 104 * |
| 105 * @return The payment methods. | 105 * @return The payment methods. |
| 106 */ | 106 */ |
| 107 public SectionInformation getPaymentMethods() { | 107 public SectionInformation getPaymentMethods() { |
| 108 return mPaymentMethods; | 108 return mPaymentMethods; |
| 109 } | 109 } |
| 110 } | 110 } |
| OLD | NEW |