| 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 6d939b74e610e67d4a019611cac1148fc463ec7f..e63247b6288de80568e133fd037f234d91a6a5e8 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
|
| @@ -227,6 +227,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
| mDialog.show();
|
|
|
| + updatePayButtonEnabled();
|
| +
|
| mClient.getDefaultPaymentInformation(new Callback<PaymentInformation>() {
|
| public void onResult(PaymentInformation result) {
|
| updateLineItems(result.getLineItems());
|
| @@ -250,6 +252,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
|
|
| mPaymentMethodsSection = result.getPaymentMethods();
|
| updateSection(mPaymentMethods, mPaymentMethodsSection, null);
|
| +
|
| + updatePayButtonEnabled();
|
| }
|
| });
|
| }
|
| @@ -482,8 +486,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| ? null : mShippingAddressesSection.getSelectedItem(),
|
| mShippingOptionsSection == null
|
| ? null : mShippingOptionsSection.getSelectedItem(),
|
| - mPaymentMethodsSection == null
|
| - ? null : mPaymentMethodsSection.getSelectedItem());
|
| + mPaymentMethodsSection.getSelectedItem());
|
| } else if (v == mEditButton) {
|
| if (mSelectedSection == null) {
|
| expand(mOrderSummaryLabel, mOrderSummary);
|
| @@ -502,6 +505,22 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| mClient.onPaymentMethodChanged(tag.getSection().getSelectedItem());
|
| }
|
| }
|
| +
|
| + updatePayButtonEnabled();
|
| + }
|
| +
|
| + private void updatePayButtonEnabled() {
|
| + if (mRequestShipping) {
|
| + mPayButton.setEnabled(mShippingAddressesSection != null
|
| + && mShippingAddressesSection.getSelectedItem() != null
|
| + && mShippingOptionsSection != null
|
| + && mShippingOptionsSection.getSelectedItem() != null
|
| + && mPaymentMethodsSection != null
|
| + && mPaymentMethodsSection.getSelectedItem() != null);
|
| + } else {
|
| + mPayButton.setEnabled(mPaymentMethodsSection != null
|
| + && mPaymentMethodsSection.getSelectedItem() != null);
|
| + }
|
| }
|
|
|
| private void expand(View sectionLabel, ViewGroup section) {
|
|
|