Commit 881b8624 authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Chromium LUCI CQ

[WebLayer] Trivial cleanups for payment ui code

This CL clean-up the files according to Android Studio's cleanup
advise. This CL does not cause any behavioural changes.

Bug: 1155582
Change-Id: Ia5d63a43e867744ee6f25f90e0cff0007e1a0fd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575756
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834040}
parent 0c6ac414
...@@ -319,8 +319,7 @@ public class ChromePaymentRequestService ...@@ -319,8 +319,7 @@ public class ChromePaymentRequestService
* @return Whether the minimal UI should be shown. * @return Whether the minimal UI should be shown.
*/ */
private boolean isMinimalUiApplicable(boolean isUserGestureShow) { private boolean isMinimalUiApplicable(boolean isUserGestureShow) {
if (!isUserGestureShow || mPaymentUiService.getPaymentApps().isEmpty() if (!isUserGestureShow || mPaymentUiService.getPaymentApps().size() != 1) {
|| mPaymentUiService.getPaymentApps().size() != 1) {
return false; return false;
} }
...@@ -428,7 +427,7 @@ public class ChromePaymentRequestService ...@@ -428,7 +427,7 @@ public class ChromePaymentRequestService
if (mDidRecordShowEvent) { if (mDidRecordShowEvent) {
assert mSpec.getRawTotal() != null; assert mSpec.getRawTotal() != null;
mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency, mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency,
mSpec.getRawTotal().amount.value, false /*completed*/); mSpec.getRawTotal().amount.value, /*completed=*/false);
} }
if (isFinishedQueryingPaymentApps && !mHasSkippedAppSelector) { if (isFinishedQueryingPaymentApps && !mHasSkippedAppSelector) {
......
...@@ -277,8 +277,8 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O ...@@ -277,8 +277,8 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
/** /**
* Length of the animation to either show the UI or expand it to full height. * Length of the animation to either show the UI or expand it to full height.
* Note that click of 'Pay' button is not accepted until the animation is done, so this duration * Note that click of 'Pay' button is not accepted until the animation is done, so this duration
* also serves the function of preventing the user from accidently double-clicking on the screen * also serves the function of preventing the user from accidentally double-clicking on the
* when triggering payment and thus authorizing unwanted transaction. * screen when triggering payment and thus authorizing unwanted transaction.
*/ */
private static final int DIALOG_ENTER_ANIMATION_MS = 225; private static final int DIALOG_ENTER_ANIMATION_MS = 225;
...@@ -305,6 +305,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O ...@@ -305,6 +305,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
private final ViewGroup mRequestView; private final ViewGroup mRequestView;
private final Callback<PaymentInformation> mUpdateSectionsCallback; private final Callback<PaymentInformation> mUpdateSectionsCallback;
private final ShippingStrings mShippingStrings; private final ShippingStrings mShippingStrings;
private final int mAnimatorTranslation;
private FadingEdgeScrollView mPaymentContainer; private FadingEdgeScrollView mPaymentContainer;
private LinearLayout mPaymentContainerLayout; private LinearLayout mPaymentContainerLayout;
...@@ -338,7 +339,6 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O ...@@ -338,7 +339,6 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
private Animator mSheetAnimator; private Animator mSheetAnimator;
private FocusAnimator mSectionAnimator; private FocusAnimator mSectionAnimator;
private int mAnimatorTranslation;
/** /**
* Builds the UI for PaymentRequest. * Builds the UI for PaymentRequest.
...@@ -652,7 +652,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O ...@@ -652,7 +652,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
mRetryErrorView.setVisibility(View.GONE); mRetryErrorView.setVisibility(View.GONE);
} else { } else {
if (mIsExpandedToFullHeight) { if (mIsExpandedToFullHeight) {
// Add paddings instead of margin to let getMeasuredHeight return correct value for // Add padding instead of margin to let getMeasuredHeight return correct value for
// section resize animation. // section resize animation.
int paddingSize = mContext.getResources().getDimensionPixelSize( int paddingSize = mContext.getResources().getDimensionPixelSize(
R.dimen.editor_dialog_section_large_spacing); R.dimen.editor_dialog_section_large_spacing);
...@@ -987,7 +987,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O ...@@ -987,7 +987,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
/** /**
* Called when the user has clicked on pay. The message is shown while the payment information * Called when the user has clicked on pay. The message is shown while the payment information
* is processed right until a confimation from the merchant is received. * is processed right until a confirmation from the merchant is received.
*/ */
public void showProcessingMessage() { public void showProcessingMessage() {
assert mIsProcessingPayClicked; assert mIsProcessingPayClicked;
...@@ -1152,7 +1152,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O ...@@ -1152,7 +1152,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
view.setMovementMethod(LinkMovementMethod.getInstance()); view.setMovementMethod(LinkMovementMethod.getInstance());
ApiCompatibilityUtils.setTextAppearance(view, R.style.TextAppearance_TextMedium_Secondary); ApiCompatibilityUtils.setTextAppearance(view, R.style.TextAppearance_TextMedium_Secondary);
// Add paddings instead of margin to let getMeasuredHeight return correct value for section // Add padding instead of margin to let getMeasuredHeight return correct value for section
// resize animation. // resize animation.
int paddingSize = mContext.getResources().getDimensionPixelSize( int paddingSize = mContext.getResources().getDimensionPixelSize(
R.dimen.editor_dialog_section_large_spacing); R.dimen.editor_dialog_section_large_spacing);
......
...@@ -384,16 +384,6 @@ public class PaymentUiService implements SettingsAutofillAndPaymentsObserver.Obs ...@@ -384,16 +384,6 @@ public class PaymentUiService implements SettingsAutofillAndPaymentsObserver.Obs
updateAppModifiedTotals(); updateAppModifiedTotals();
} }
/** Get the ShippingAddressesSection of the PaymentRequest UI. */
public SectionInformation getShippingAddressesSection() {
return mShippingAddressesSection;
}
/** Get the ContactSection of the PaymentRequest UI. */
public ContactDetailsSection getContactSection() {
return mContactSection;
}
/** Set the AutofillPaymentAppCreator. */ /** Set the AutofillPaymentAppCreator. */
public void setAutofillPaymentAppCreator(AutofillPaymentAppCreator autofillPaymentAppCreator) { public void setAutofillPaymentAppCreator(AutofillPaymentAppCreator autofillPaymentAppCreator) {
mAutofillPaymentAppCreator = autofillPaymentAppCreator; mAutofillPaymentAppCreator = autofillPaymentAppCreator;
...@@ -418,14 +408,6 @@ public class PaymentUiService implements SettingsAutofillAndPaymentsObserver.Obs ...@@ -418,14 +408,6 @@ public class PaymentUiService implements SettingsAutofillAndPaymentsObserver.Obs
mHandler.post(callback.bind(mUiShoppingCart)); mHandler.post(callback.bind(mUiShoppingCart));
} }
/**
* The UI model for the shipping options. Includes the label and sublabel for each shipping
* option. Also keeps track of the selected shipping option. This data is passed to the UI.
*/
public SectionInformation getUiShippingOptions() {
return mUiShippingOptions;
}
/** @return The selected contact, can be null. */ /** @return The selected contact, can be null. */
@Nullable @Nullable
public AutofillContact getSelectedContact() { public AutofillContact getSelectedContact() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment