| 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 af609332fa795429a0d7bff978671fc7c2ec5195..914252deca1d9186df0c617f752160253d2e173e 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
|
| @@ -63,7 +63,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| PaymentRequestSection.SectionDelegate {
|
| public static final int TYPE_SHIPPING_ADDRESSES = 1;
|
| public static final int TYPE_SHIPPING_OPTIONS = 2;
|
| - public static final int TYPE_CONTACT_DETAILS = 3;
|
| + public static final int TYPE_PAYER_INFO_DETAILS = 3;
|
| public static final int TYPE_PAYMENT_METHODS = 4;
|
|
|
| public static final int SELECTION_RESULT_ASYNCHRONOUS_VALIDATION = 1;
|
| @@ -74,7 +74,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| @IntDef({
|
| TYPE_SHIPPING_ADDRESSES,
|
| TYPE_SHIPPING_OPTIONS,
|
| - TYPE_CONTACT_DETAILS,
|
| + TYPE_PAYER_INFO_DETAILS,
|
| TYPE_PAYMENT_METHODS
|
| })
|
| public @interface DataType {}
|
| @@ -261,7 +261,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| private final Context mContext;
|
| private final Client mClient;
|
| private final boolean mRequestShipping;
|
| - private final boolean mRequestContactDetails;
|
| + private final boolean mRequestPayerInfoDetails;
|
|
|
| private final Dialog mDialog;
|
| private final EditorView mEditorView;
|
| @@ -283,7 +283,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| private ExtraTextSection mShippingSummarySection;
|
| private OptionSection mShippingAddressSection;
|
| private OptionSection mShippingOptionSection;
|
| - private OptionSection mContactDetailsSection;
|
| + private OptionSection mPayerInfoDetailsSection;
|
| private OptionSection mPaymentMethodSection;
|
| private List<SectionSeparator> mSectionSeparators;
|
|
|
| @@ -299,7 +299,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| private SectionInformation mPaymentMethodSectionInformation;
|
| private SectionInformation mShippingAddressSectionInformation;
|
| private SectionInformation mShippingOptionsSectionInformation;
|
| - private SectionInformation mContactDetailsSectionInformation;
|
| + private SectionInformation mPayerInfoDetailsSectionInformation;
|
|
|
| private Animator mSheetAnimator;
|
| private FocusAnimator mSectionAnimator;
|
| @@ -312,7 +312,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| * @param activity The activity on top of which the UI should be displayed.
|
| * @param client The consumer of the PaymentRequest UI.
|
| * @param requestShipping Whether the UI should show the shipping address and option selection.
|
| - * @param requestContact Whether the UI should show the email address and phone number
|
| + * @param requestPayerInfo Whether the UI should show the email address and phone number
|
| * selection.
|
| * @param canAddCards Whether the UI should show the [+ADD CARD] button. This can be false,
|
| * for example, when the merchant does not accept credit cards, so
|
| @@ -326,11 +326,11 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| * https://www.chromium.org/Home/chromium-security/enamel#TOC-Eliding-Origin-Names-And-Hostnames
|
| */
|
| public PaymentRequestUI(Activity activity, Client client, boolean requestShipping,
|
| - boolean requestContact, boolean canAddCards, String title, String origin) {
|
| + boolean requestPayerInfo, boolean canAddCards, String title, String origin) {
|
| mContext = activity;
|
| mClient = client;
|
| mRequestShipping = requestShipping;
|
| - mRequestContactDetails = requestContact;
|
| + mRequestPayerInfoDetails = requestPayerInfo;
|
| mAnimatorTranslation = activity.getResources().getDimensionPixelSize(
|
| R.dimen.payments_ui_translation);
|
|
|
| @@ -357,8 +357,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| updateSection(TYPE_SHIPPING_ADDRESSES, result.getShippingAddresses());
|
| updateSection(TYPE_SHIPPING_OPTIONS, result.getShippingOptions());
|
| }
|
| - if (mRequestContactDetails) {
|
| - updateSection(TYPE_CONTACT_DETAILS, result.getContactDetails());
|
| + if (mRequestPayerInfoDetails) {
|
| + updateSection(TYPE_PAYER_INFO_DETAILS, result.getPayerInfoDetails());
|
| }
|
| updateSection(TYPE_PAYMENT_METHODS, result.getPaymentMethods());
|
| if (mShippingAddressSectionInformation.getSelectedItem() == null) {
|
| @@ -442,8 +442,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| }
|
| }
|
|
|
| - if (mRequestContactDetails) {
|
| - updateSection(TYPE_CONTACT_DETAILS, result.getContactDetails());
|
| + if (mRequestPayerInfoDetails) {
|
| + updateSection(TYPE_PAYER_INFO_DETAILS, result.getPayerInfoDetails());
|
| }
|
|
|
| updateSection(TYPE_PAYMENT_METHODS, result.getPaymentMethods());
|
| @@ -507,8 +507,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| activity, activity.getString(R.string.payments_shipping_address_label), this);
|
| mShippingOptionSection = new OptionSection(
|
| activity, activity.getString(R.string.payments_shipping_option_label), this);
|
| - mContactDetailsSection = new OptionSection(
|
| - activity, activity.getString(R.string.payments_contact_details_label), this);
|
| + mPayerInfoDetailsSection = new OptionSection(
|
| + activity, activity.getString(R.string.payments_payer_info_details_label), this);
|
| mPaymentMethodSection = new OptionSection(
|
| activity, activity.getString(R.string.payments_method_of_payment_label), this);
|
|
|
| @@ -528,10 +528,10 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| }
|
| mPaymentContainerLayout.addView(mPaymentMethodSection, new LinearLayout.LayoutParams(
|
| LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
|
| - if (mRequestContactDetails) {
|
| - // Contact details are optional, depending on the merchant website.
|
| + if (mRequestPayerInfoDetails) {
|
| + // Payer info details are optional, depending on the merchant website.
|
| mSectionSeparators.add(new SectionSeparator(mPaymentContainerLayout));
|
| - mPaymentContainerLayout.addView(mContactDetailsSection, new LinearLayout.LayoutParams(
|
| + mPaymentContainerLayout.addView(mPayerInfoDetailsSection, new LinearLayout.LayoutParams(
|
| LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
|
| }
|
| mRequestView.addOnLayoutChangeListener(new FadeInAnimator());
|
| @@ -623,9 +623,9 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| } else if (whichSection == TYPE_SHIPPING_OPTIONS) {
|
| mShippingOptionsSectionInformation = section;
|
| mShippingOptionSection.update(section);
|
| - } else if (whichSection == TYPE_CONTACT_DETAILS) {
|
| - mContactDetailsSectionInformation = section;
|
| - mContactDetailsSection.update(section);
|
| + } else if (whichSection == TYPE_PAYER_INFO_DETAILS) {
|
| + mPayerInfoDetailsSectionInformation = section;
|
| + mPayerInfoDetailsSection.update(section);
|
| } else if (whichSection == TYPE_PAYMENT_METHODS) {
|
| mPaymentMethodSectionInformation = section;
|
| mPaymentMethodSection.update(section);
|
| @@ -648,9 +648,9 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| mShippingOptionsSectionInformation.setSelectedItem(option);
|
| result = mClient.onSectionOptionSelected(
|
| TYPE_SHIPPING_OPTIONS, option, mUpdateSectionsCallback);
|
| - } else if (section == mContactDetailsSection) {
|
| - mContactDetailsSectionInformation.setSelectedItem(option);
|
| - result = mClient.onSectionOptionSelected(TYPE_CONTACT_DETAILS, option, null);
|
| + } else if (section == mPayerInfoDetailsSection) {
|
| + mPayerInfoDetailsSectionInformation.setSelectedItem(option);
|
| + result = mClient.onSectionOptionSelected(TYPE_PAYER_INFO_DETAILS, option, null);
|
| } else if (section == mPaymentMethodSection) {
|
| mPaymentMethodSectionInformation.setSelectedItem(option);
|
| result = mClient.onSectionOptionSelected(TYPE_PAYMENT_METHODS, option, null);
|
| @@ -674,8 +674,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| @SelectionResult int result = SELECTION_RESULT_NONE;
|
| if (section == mShippingAddressSection) {
|
| result = mClient.onSectionAddOption(TYPE_SHIPPING_ADDRESSES, mUpdateSectionsCallback);
|
| - } else if (section == mContactDetailsSection) {
|
| - result = mClient.onSectionAddOption(TYPE_CONTACT_DETAILS, null);
|
| + } else if (section == mPayerInfoDetailsSection) {
|
| + result = mClient.onSectionAddOption(TYPE_PAYER_INFO_DETAILS, null);
|
| } else if (section == mPaymentMethodSection) {
|
| result = mClient.onSectionAddOption(TYPE_PAYMENT_METHODS, null);
|
| }
|
| @@ -740,8 +740,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| expand(mShippingAddressSection);
|
| } else if (v == mShippingOptionSection) {
|
| expand(mShippingOptionSection);
|
| - } else if (v == mContactDetailsSection) {
|
| - expand(mContactDetailsSection);
|
| + } else if (v == mPayerInfoDetailsSection) {
|
| + expand(mPayerInfoDetailsSection);
|
| } else if (v == mPaymentMethodSection) {
|
| expand(mPaymentMethodSection);
|
| } else if (v == mPayButton) {
|
| @@ -840,15 +840,15 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| }
|
|
|
| private void updatePayButtonEnabled() {
|
| - boolean contactInfoOk = !mRequestContactDetails
|
| - || (mContactDetailsSectionInformation != null
|
| - && mContactDetailsSectionInformation.getSelectedItem() != null);
|
| + boolean payerInfoOk = !mRequestPayerInfoDetails
|
| + || (mPayerInfoDetailsSectionInformation != null
|
| + && mPayerInfoDetailsSectionInformation.getSelectedItem() != null);
|
| boolean shippingInfoOk = !mRequestShipping
|
| || (mShippingAddressSectionInformation != null
|
| && mShippingAddressSectionInformation.getSelectedItem() != null
|
| && mShippingOptionsSectionInformation != null
|
| && mShippingOptionsSectionInformation.getSelectedItem() != null);
|
| - mPayButton.setEnabled(contactInfoOk && shippingInfoOk
|
| + mPayButton.setEnabled(payerInfoOk && shippingInfoOk
|
| && mPaymentMethodSectionInformation != null
|
| && mPaymentMethodSectionInformation.getSelectedItem() != null
|
| && !mIsClientCheckingSelection
|
| @@ -929,9 +929,9 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| } else if (mSelectedSection == mShippingOptionSection) {
|
| mClient.getSectionInformation(
|
| TYPE_SHIPPING_OPTIONS, createUpdateSectionCallback(TYPE_SHIPPING_OPTIONS));
|
| - } else if (mSelectedSection == mContactDetailsSection) {
|
| + } else if (mSelectedSection == mPayerInfoDetailsSection) {
|
| mClient.getSectionInformation(
|
| - TYPE_CONTACT_DETAILS, createUpdateSectionCallback(TYPE_CONTACT_DETAILS));
|
| + TYPE_PAYER_INFO_DETAILS, createUpdateSectionCallback(TYPE_PAYER_INFO_DETAILS));
|
| } else if (mSelectedSection == mPaymentMethodSection) {
|
| mClient.getSectionInformation(
|
| TYPE_PAYMENT_METHODS, createUpdateSectionCallback(TYPE_PAYMENT_METHODS));
|
| @@ -956,7 +956,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| mOrderSummarySection.focusSection(mSelectedSection == mOrderSummarySection);
|
| mShippingAddressSection.focusSection(mSelectedSection == mShippingAddressSection);
|
| mShippingOptionSection.focusSection(mSelectedSection == mShippingOptionSection);
|
| - mContactDetailsSection.focusSection(mSelectedSection == mContactDetailsSection);
|
| + mPayerInfoDetailsSection.focusSection(mSelectedSection == mPayerInfoDetailsSection);
|
| mPaymentMethodSection.focusSection(mSelectedSection == mPaymentMethodSection);
|
| updateSectionButtons();
|
| }
|
| @@ -1231,8 +1231,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
|
| }
|
|
|
| @VisibleForTesting
|
| - public ViewGroup getContactDetailsSectionForTest() {
|
| - return mContactDetailsSection;
|
| + public ViewGroup getPayerInfoDetailsSectionForTest() {
|
| + return mPayerInfoDetailsSection;
|
| }
|
|
|
| private void notifyReadyForInput() {
|
|
|