Chromium Code Reviews| 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 06bf964172c65de8d180ec1d4b8670dbb0d33201..a232f1733eac95d211499af7d7884837bd0e995f 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 |
| @@ -22,6 +22,9 @@ public class PaymentAppFactory { |
| */ |
| private static PaymentAppFactoryAddition sAdditionalFactory; |
| + private static WebBasedPaymentAppBridge sWebBasedPaymentAppBridge = |
| + new WebBasedPaymentAppBridge(); |
| + |
| /** |
| * The interface for additional payment app factories. |
| */ |
| @@ -54,10 +57,28 @@ public class PaymentAppFactory { |
| public static List<PaymentApp> create(Context context, WebContents webContents) { |
| List<PaymentApp> result = new ArrayList<>(2); |
| result.add(new AutofillPaymentApp(context, webContents)); |
| + result.addAll(createWebBasedPaymentApps(context, webContents)); |
|
please use gerrit instead
2016/11/29 14:28:44
Put this behind a command-line flag before it's 10
tommyt
2016/11/30 13:44:38
Done.
|
| if (sAdditionalFactory != null) { |
| result.addAll( |
| sAdditionalFactory.create(context, webContents)); |
| } |
| return result; |
| } |
| + |
| + /** |
| + * Build a WebBasedPaymentApp instance for each installed web based |
| + * payment app. |
| + * |
| + * @param context The context. |
| + * @param webContents The web contents where PaymentRequest was invoked. |
| + */ |
| + private static List<WebBasedPaymentApp> createWebBasedPaymentApps( |
| + Context context, WebContents webContents) { |
|
agrieve
2016/11/28 17:59:53
Here and in other places, you should try and say w
tommyt
2016/11/30 13:44:38
Yeah, this did actually turn out a bit cargo-cult-
|
| + List<WebBasedPaymentApp> result = new ArrayList<>(); |
| + for (WebBasedPaymentAppBridge.Manifest manifest : |
| + sWebBasedPaymentAppBridge.getAllAppManifests()) { |
| + result.add(new WebBasedPaymentApp(context, webContents, manifest)); |
| + } |
| + return result; |
| + } |
| } |