Commit bf79a642 authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

[WebLayer] Extracts trigger-skip-ui out of continueShow

Before the CL:
- CPRService#continueShow() calls
  CPRService#triggerPaymentAppUiSkipIfApplicable()

After the CL:
- PRService#continueShow() calls
  PRService#triggerPaymentAppUiSkipIfApplicable()

Bug: 1147092
Change-Id: I11a5af8815759b04738ed2f423c8a5921b4efdc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2543131
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828448}
parent 823a1dd8
......@@ -432,9 +432,6 @@ public class ChromePaymentRequestService
mSpec.getRawTotal().amount.value, false /*completed*/);
}
String error = triggerPaymentAppUiSkipIfApplicable(isUserGestureShow);
if (error != null) return error;
if (isFinishedQueryingPaymentApps
&& !mPaymentUiService.shouldSkipShowingPaymentRequestUi()) {
boolean providedInformationToPaymentRequestUI =
......
......@@ -958,17 +958,20 @@ public class PaymentRequestService
triggerPaymentAppUiSkipIfApplicable();
}
private void triggerPaymentAppUiSkipIfApplicable() {
// Return the error if failed, null if success.
@Nullable
private String triggerPaymentAppUiSkipIfApplicable() {
if (!mIsFinishedQueryingPaymentApps || !mIsCurrentPaymentRequestShowing
|| mIsShowWaitingForUpdatedDetails) {
return;
return null;
}
String error =
mBrowserPaymentRequest.triggerPaymentAppUiSkipIfApplicable(mIsUserGestureShow);
if (error != null) {
onShowFailed(error);
return;
return error;
}
return null;
}
// Implements PaymentDetailsConverter.MethodChecker:
......@@ -998,7 +1001,7 @@ public class PaymentRequestService
String error = mBrowserPaymentRequest.continueShow(
mIsFinishedQueryingPaymentApps, mIsUserGestureShow);
if (error != null) return error;
return null;
return triggerPaymentAppUiSkipIfApplicable();
}
/**
......
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