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 ...@@ -432,9 +432,6 @@ public class ChromePaymentRequestService
mSpec.getRawTotal().amount.value, false /*completed*/); mSpec.getRawTotal().amount.value, false /*completed*/);
} }
String error = triggerPaymentAppUiSkipIfApplicable(isUserGestureShow);
if (error != null) return error;
if (isFinishedQueryingPaymentApps if (isFinishedQueryingPaymentApps
&& !mPaymentUiService.shouldSkipShowingPaymentRequestUi()) { && !mPaymentUiService.shouldSkipShowingPaymentRequestUi()) {
boolean providedInformationToPaymentRequestUI = boolean providedInformationToPaymentRequestUI =
......
...@@ -958,17 +958,20 @@ public class PaymentRequestService ...@@ -958,17 +958,20 @@ public class PaymentRequestService
triggerPaymentAppUiSkipIfApplicable(); triggerPaymentAppUiSkipIfApplicable();
} }
private void triggerPaymentAppUiSkipIfApplicable() { // Return the error if failed, null if success.
@Nullable
private String triggerPaymentAppUiSkipIfApplicable() {
if (!mIsFinishedQueryingPaymentApps || !mIsCurrentPaymentRequestShowing if (!mIsFinishedQueryingPaymentApps || !mIsCurrentPaymentRequestShowing
|| mIsShowWaitingForUpdatedDetails) { || mIsShowWaitingForUpdatedDetails) {
return; return null;
} }
String error = String error =
mBrowserPaymentRequest.triggerPaymentAppUiSkipIfApplicable(mIsUserGestureShow); mBrowserPaymentRequest.triggerPaymentAppUiSkipIfApplicable(mIsUserGestureShow);
if (error != null) { if (error != null) {
onShowFailed(error); onShowFailed(error);
return; return error;
} }
return null;
} }
// Implements PaymentDetailsConverter.MethodChecker: // Implements PaymentDetailsConverter.MethodChecker:
...@@ -998,7 +1001,7 @@ public class PaymentRequestService ...@@ -998,7 +1001,7 @@ public class PaymentRequestService
String error = mBrowserPaymentRequest.continueShow( String error = mBrowserPaymentRequest.continueShow(
mIsFinishedQueryingPaymentApps, mIsUserGestureShow); mIsFinishedQueryingPaymentApps, mIsUserGestureShow);
if (error != null) return error; 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