Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java |
| index 4bfd7a23bd91ec2498d83b3d326a4b79a5ecaea1..1873f3192f4ce5e27d3213b2f5cabd17ff56a7c4 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java |
| @@ -57,7 +57,7 @@ import java.util.List; |
| * The PaymentRequest UI. |
| */ |
| public class PaymentRequestUI implements DialogInterface.OnDismissListener, View.OnClickListener, |
| - PaymentRequestSection.PaymentsSectionDelegate { |
| + PaymentRequestSection.SectionDelegate { |
| public static final int TYPE_SHIPPING_ADDRESSES = 1; |
| public static final int TYPE_SHIPPING_OPTIONS = 2; |
| public static final int TYPE_PAYMENT_METHODS = 3; |
| @@ -118,6 +118,12 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View |
| * or the “X” button in UI. |
| */ |
| void onDismiss(); |
| + |
| + /** |
| + * Checks if the merchant needs a shipping address for the order. |
|
please use gerrit instead
2016/06/03 23:21:22
Checks if the merchant needs a shipping address to
gone
2016/06/03 23:37:17
Done.
|
| + * @return Whether or not the merchant needs a shipping address. |
| + */ |
| + boolean merchantNeedsShippingAddress(); |
| } |
| /** |
| @@ -696,6 +702,18 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View |
| if (!mIsClientClosing) mClient.onDismiss(); |
| } |
| + @Override |
| + public String getAdditionalText(OptionSection section) { |
| + if (section == mShippingAddressSection) { |
| + int selectedItemIndex = mShippingAddressSectionInformation.getSelectedItemIndex(); |
| + boolean isNecessary = mClient.merchantNeedsShippingAddress() |
| + && selectedItemIndex == SectionInformation.NO_SELECTION; |
| + return isNecessary ? mContext.getString( |
| + R.string.payments_select_shipping_address_for_shipping_methods) : null; |
| + } |
| + return null; |
| + } |
| + |
| /** |
| * Animates the whole dialog fading in and darkening everything else on screen. |
| * This particular animation is not tracked because it is not meant to be cancelable. |