| 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..d49af8996009774bef5ff6c9d85930039ec64065 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 to provide the shipping options.
|
| + * @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.
|
|
|