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
* @return Whether the minimal UI should be shown.
*/
private boolean isMinimalUiApplicable(boolean isUserGestureShow) {
if (!isUserGestureShow || mPaymentUiService.getPaymentApps().isEmpty()
|| mPaymentUiService.getPaymentApps().size() != 1) {
if (!isUserGestureShow || mPaymentUiService.getPaymentApps().size() != 1) {
return false;
}
......@@ -428,7 +427,7 @@ public class ChromePaymentRequestService
if (mDidRecordShowEvent) {
assert mSpec.getRawTotal() != null;
mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency,
mSpec.getRawTotal().amount.value, false /*completed*/);
mSpec.getRawTotal().amount.value, /*completed=*/false);
}
if (isFinishedQueryingPaymentApps && !mHasSkippedAppSelector) {
......
......@@ -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.
* 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
* when triggering payment and thus authorizing unwanted transaction.
* also serves the function of preventing the user from accidentally double-clicking on the
* screen when triggering payment and thus authorizing unwanted transaction.
*/
private static final int DIALOG_ENTER_ANIMATION_MS = 225;
......@@ -305,6 +305,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
private final ViewGroup mRequestView;
private final Callback<PaymentInformation> mUpdateSectionsCallback;
private final ShippingStrings mShippingStrings;
private final int mAnimatorTranslation;
private FadingEdgeScrollView mPaymentContainer;
private LinearLayout mPaymentContainerLayout;
......@@ -338,7 +339,6 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
private Animator mSheetAnimator;
private FocusAnimator mSectionAnimator;
private int mAnimatorTranslation;
/**
* Builds the UI for PaymentRequest.
......@@ -652,7 +652,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
mRetryErrorView.setVisibility(View.GONE);
} else {
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.
int paddingSize = mContext.getResources().getDimensionPixelSize(
R.dimen.editor_dialog_section_large_spacing);
......@@ -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
* 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() {
assert mIsProcessingPayClicked;
......@@ -1152,7 +1152,7 @@ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.O
view.setMovementMethod(LinkMovementMethod.getInstance());
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.
int paddingSize = mContext.getResources().getDimensionPixelSize(
R.dimen.editor_dialog_section_large_spacing);
......
......@@ -384,16 +384,6 @@ public class PaymentUiService implements SettingsAutofillAndPaymentsObserver.Obs
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. */
public void setAutofillPaymentAppCreator(AutofillPaymentAppCreator autofillPaymentAppCreator) {
mAutofillPaymentAppCreator = autofillPaymentAppCreator;
......@@ -418,14 +408,6 @@ public class PaymentUiService implements SettingsAutofillAndPaymentsObserver.Obs
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. */
@Nullable
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