| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java
|
| index 25fd9c119d9a6c7494e57d7ddf5aa7b6c3d51572..b2fe51dc66251d1380c900fe21312fcb80a4fae1 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java
|
| @@ -7,6 +7,7 @@ package org.chromium.chrome.browser.payments;
|
| import org.chromium.base.VisibleForTesting;
|
| import org.chromium.chrome.browser.ChromeFeatureList;
|
| import org.chromium.content_public.browser.WebContents;
|
| +import org.chromium.payments.mojom.PaymentRequestClient.ParsePaymentManifestResponse;
|
|
|
| import java.util.ArrayList;
|
| import java.util.HashSet;
|
| @@ -25,9 +26,7 @@ public class PaymentAppFactory {
|
| */
|
| private final List<PaymentAppFactoryAddition> mAdditionalFactories;
|
|
|
| - /**
|
| - * Interface for receiving newly created apps.
|
| - */
|
| + /** Interface for receiving newly created apps. */
|
| public interface PaymentAppCreatedCallback {
|
| /**
|
| * Called when the factory has create a payment app. This method may be called
|
| @@ -35,25 +34,33 @@ public class PaymentAppFactory {
|
| */
|
| void onPaymentAppCreated(PaymentApp paymentApp);
|
|
|
| + /** Called when the factory is finished creating payment apps. */
|
| + void onAllPaymentAppsCreated();
|
| + }
|
| +
|
| + /** Interface for parsing payment manifest. */
|
| + public interface PaymentManifestParser {
|
| /**
|
| - * Called when the factory is finished creating payment apps.
|
| + * Parses the payment manifest.
|
| + *
|
| + * @param content The content to parse.
|
| + * @param callback The callback to invoke with parsed data, or null on failure.
|
| */
|
| - void onAllPaymentAppsCreated();
|
| + void parsePaymentManifest(String content, ParsePaymentManifestResponse callback);
|
| }
|
|
|
| - /**
|
| - * The interface for additional payment app factories.
|
| - */
|
| + /** The interface for additional payment app factories. */
|
| public interface PaymentAppFactoryAddition {
|
| /**
|
| * Builds instances of payment apps.
|
| *
|
| * @param webContents The web contents that invoked PaymentRequest.
|
| * @param methods The methods that the merchant supports.
|
| + * @param parser The payment manifest parser.
|
| * @param callback The callback to invoke when apps are created.
|
| */
|
| - void create(
|
| - WebContents webContents, Set<String> methods, PaymentAppCreatedCallback callback);
|
| + void create(WebContents webContents, Set<String> methods, PaymentManifestParser parser,
|
| + PaymentAppCreatedCallback callback);
|
| }
|
|
|
| private PaymentAppFactory() {
|
| @@ -91,9 +98,10 @@ public class PaymentAppFactory {
|
| *
|
| * @param webContents The web contents where PaymentRequest was invoked.
|
| * @param methods The methods that the merchant supports.
|
| + * @param parser The payment manifest parser.
|
| * @param callback The callback to invoke when apps are created.
|
| */
|
| - public void create(WebContents webContents, Set<String> methods,
|
| + public void create(WebContents webContents, Set<String> methods, PaymentManifestParser parser,
|
| final PaymentAppCreatedCallback callback) {
|
| callback.onPaymentAppCreated(new AutofillPaymentApp(webContents));
|
|
|
| @@ -119,7 +127,7 @@ public class PaymentAppFactory {
|
| if (mPendingTasks.isEmpty()) callback.onAllPaymentAppsCreated();
|
| }
|
| };
|
| - additionalFactory.create(webContents, methods, cb);
|
| + additionalFactory.create(webContents, methods, parser, cb);
|
| }
|
| }
|
| }
|
|
|