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..61145d0dfba757a9899f5eb13476f98c8976d1c1 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 |
@@ -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; |
@@ -309,28 +309,28 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View |
/** |
* Builds the UI for PaymentRequest. |
* |
- * @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 |
- * 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 |
- * there's no point in adding cards within PaymentRequest UI. |
- * @param title The title to show at the top of the UI. This can be, for example, the |
- * <title> of the merchant website. If the string is too long for |
- * UI, it elides at the end. |
- * @param origin The origin (part of URL) to show under the title. For example, |
- * "https://shop.momandpop.com". If the origin is too long for the UI, it |
- * should elide according to: |
+ * @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 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 |
+ * there's no point in adding cards within PaymentRequest UI. |
+ * @param title The title to show at the top of the UI. This can be, for example, the |
+ * <title> of the merchant website. If the string is too long for |
+ * UI, it elides at the end. |
+ * @param origin The origin (part of URL) to show under the title. For example, |
+ * "https://shop.momandpop.com". If the origin is too long for the UI, |
+ * it should elide according to: |
* 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_CONTACT_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_CONTACT_DETAILS, result.getPayerInfoDetails()); |
} |
updateSection(TYPE_PAYMENT_METHODS, result.getPaymentMethods()); |
@@ -507,7 +507,7 @@ 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( |
+ mPayerInfoDetailsSection = new OptionSection( |
activity, activity.getString(R.string.payments_contact_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 information 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()); |
@@ -624,8 +624,8 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View |
mShippingOptionsSectionInformation = section; |
mShippingOptionSection.update(section); |
} else if (whichSection == TYPE_CONTACT_DETAILS) { |
- mContactDetailsSectionInformation = section; |
- mContactDetailsSection.update(section); |
+ mPayerInfoDetailsSectionInformation = section; |
+ mPayerInfoDetailsSection.update(section); |
} else if (whichSection == TYPE_PAYMENT_METHODS) { |
mPaymentMethodSectionInformation = section; |
mPaymentMethodSection.update(section); |
@@ -648,8 +648,8 @@ 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); |
+ } else if (section == mPayerInfoDetailsSection) { |
+ mPayerInfoDetailsSectionInformation.setSelectedItem(option); |
result = mClient.onSectionOptionSelected(TYPE_CONTACT_DETAILS, option, null); |
} else if (section == mPaymentMethodSection) { |
mPaymentMethodSectionInformation.setSelectedItem(option); |
@@ -674,7 +674,7 @@ 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) { |
+ } else if (section == mPayerInfoDetailsSection) { |
result = mClient.onSectionAddOption(TYPE_CONTACT_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,7 +929,7 @@ 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)); |
} else if (mSelectedSection == mPaymentMethodSection) { |
@@ -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() { |