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

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

Issue 2467393002: Add canMakeActivePayment() method to web payments. (Closed)
Patch Set: Fix FindBugs Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java
index e5d6462ae79869fb2761cc9f4270d44e8c59558d..ac113a7fade22906552af6278c143adaf5a317b8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java
@@ -7,10 +7,10 @@ package org.chromium.chrome.browser.payments;
import android.app.Activity;
import org.chromium.chrome.browser.ChromeFeatureList;
-import org.chromium.chrome.browser.payments.PaymentRequestImpl.PaymentRequestDismissObserver;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content_public.browser.WebContents;
import org.chromium.mojo.system.MojoException;
+import org.chromium.payments.mojom.ActivePaymentQueryResult;
import org.chromium.payments.mojom.PaymentDetails;
import org.chromium.payments.mojom.PaymentErrorReason;
import org.chromium.payments.mojom.PaymentMethodData;
@@ -23,10 +23,8 @@ import org.chromium.ui.base.WindowAndroid;
/**
* Creates instances of PaymentRequest.
*/
-public class PaymentRequestFactory
- implements InterfaceFactory<PaymentRequest>, PaymentRequestDismissObserver {
+public class PaymentRequestFactory implements InterfaceFactory<PaymentRequest> {
private final WebContents mWebContents;
- private boolean mIsPaymentRequestRunning;
/**
* An implementation of PaymentRequest that immediately rejects all connections.
@@ -59,6 +57,13 @@ public class PaymentRequestFactory
public void complete(int result) {}
@Override
+ public void canMakeActivePayment() {
+ if (mClient != null) {
+ mClient.onCanMakeActivePayment(ActivePaymentQueryResult.CANNOT_MAKE_ACTIVE_PAYMENT);
+ }
+ }
+
+ @Override
public void close() {}
@Override
@@ -91,14 +96,6 @@ public class PaymentRequestFactory
Activity context = window.getActivity().get();
if (context == null) return new InvalidPaymentRequest();
- if (mIsPaymentRequestRunning) return new InvalidPaymentRequest();
- mIsPaymentRequestRunning = true;
-
- return new PaymentRequestImpl(context, mWebContents, this);
- }
-
- @Override
- public void onPaymentRequestDismissed() {
- mIsPaymentRequestRunning = false;
+ return new PaymentRequestImpl(context, mWebContents);
}
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698