Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1762)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java

Issue 2247493002: Enable closing while processing payment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test #2 Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
index 8335a577a6ad26427c9f49753eca959e74924931..f094d25cb3eda5e53322235d61ef70465980a398 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -836,7 +836,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
@Override
public void onDismiss() {
disconnectFromClientWithDebugMessage("Dialog dismissed");
- closeUI(false);
+ closeUI(true);
recordAbortReasonHistogram(PaymentRequestMetrics.ABORT_REASON_ABORTED_BY_USER);
}
@@ -848,7 +848,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
Log.d(TAG, debugMessage);
if (mClient != null) mClient.onError(reason);
closeClient();
- closeUI(false);
+ closeUI(true);
}
@Override
@@ -867,7 +867,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
if (sObserverForTest != null) sObserverForTest.onPaymentRequestServiceUnableToAbort();
} else {
closeClient();
- closeUI(false);
+ closeUI(true);
recordAbortReasonHistogram(PaymentRequestMetrics.ABORT_REASON_ABORTED_BY_MERCHANT);
}
}
@@ -889,7 +889,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
public void close() {
if (mClient == null) return;
closeClient();
- closeUI(false);
+ closeUI(true);
recordAbortReasonHistogram(PaymentRequestMetrics.ABORT_REASON_MOJO_RENDERER_CLOSING);
}
@@ -900,7 +900,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
public void onConnectionError(MojoException e) {
if (mClient == null) return;
closeClient();
- closeUI(false);
+ closeUI(true);
recordAbortReasonHistogram(PaymentRequestMetrics.ABORT_REASON_MOJO_CONNECTION_ERROR);
}
@@ -1070,6 +1070,14 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
/**
* Closes the UI. If the client is still connected, then it's notified of UI hiding.
+ *
+ * @param immediateClose If true, then UI immediately closes. If false, the UI shows the error
+ * message "There was an error processing your order." This message
+ * implies that the merchant attempted to process the order, failed, and
+ * called complete("fail") to notify the user. Therefore, this parameter
+ * may be "false" only when called from
+ * PaymentRequestImpl.complete(int result) method. All other callers
+ * should always pass "true."
*/
private void closeUI(boolean immediateClose) {
if (mUI != null) {

Powered by Google App Engine
This is Rietveld 408576698