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

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

Issue 1964323002: Reland: Test dismissing CVC prompt for PaymentRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 5f3f04bf9955fe3c38af54b26a6d626e1c9a272e..831864ae1686fed829f04944bf488aa10e21eecc 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
@@ -497,7 +497,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
*/
@Override
public void abort() {
- mClient = null;
+ closeClient();
closeUI(false);
}
@@ -514,7 +514,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
*/
@Override
public void close() {
- mClient = null;
+ closeClient();
closeUI(false);
}
@@ -523,7 +523,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
*/
@Override
public void onConnectionError(MojoException e) {
- mClient = null;
+ closeClient();
closeUI(false);
}
@@ -595,7 +595,7 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
private void disconnectFromClientWithDebugMessage(String debugMessage) {
Log.d(TAG, debugMessage);
mClient.onError();
- mClient = null;
+ closeClient();
}
/**
@@ -606,9 +606,8 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
mUI.close(paymentSuccess, new Runnable() {
@Override
public void run() {
- if (mClient == null) return;
- mClient.onComplete();
- mClient = null;
+ if (mClient != null) mClient.onComplete();
+ closeClient();
}
});
mUI = null;
@@ -623,4 +622,9 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
mPaymentMethodsSection = null;
}
}
+
+ private void closeClient() {
+ if (mClient != null) mClient.close();
+ mClient = null;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698