| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.payments; | 5 package org.chromium.chrome.browser.payments; |
| 6 | 6 |
| 7 import android.content.Context; | |
| 8 | |
| 9 import org.chromium.base.VisibleForTesting; | 7 import org.chromium.base.VisibleForTesting; |
| 10 import org.chromium.content_public.browser.WebContents; | 8 import org.chromium.content_public.browser.WebContents; |
| 11 | 9 |
| 12 import java.util.ArrayList; | 10 import java.util.ArrayList; |
| 13 import java.util.List; | 11 import java.util.List; |
| 14 | 12 |
| 15 /** | 13 /** |
| 16 * Builds instances of payment apps. | 14 * Builds instances of payment apps. |
| 17 */ | 15 */ |
| 18 public class PaymentAppFactory { | 16 public class PaymentAppFactory { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 40 @VisibleForTesting | 38 @VisibleForTesting |
| 41 public static void setAdditionalFactory(PaymentAppFactoryAddition additional
Factory) { | 39 public static void setAdditionalFactory(PaymentAppFactoryAddition additional
Factory) { |
| 42 sAdditionalFactory = additionalFactory; | 40 sAdditionalFactory = additionalFactory; |
| 43 } | 41 } |
| 44 | 42 |
| 45 /** | 43 /** |
| 46 * Builds instances of payment apps. | 44 * Builds instances of payment apps. |
| 47 * | 45 * |
| 48 * @param webContents The web contents where PaymentRequest was invoked. | 46 * @param webContents The web contents where PaymentRequest was invoked. |
| 49 */ | 47 */ |
| 50 public static List<PaymentApp> create(Context context, WebContents webConten
ts) { | 48 public static List<PaymentApp> create(WebContents webContents) { |
| 51 List<PaymentApp> result = new ArrayList<>(2); | 49 List<PaymentApp> result = new ArrayList<>(2); |
| 52 result.add(new AutofillPaymentApp(context, webContents)); | 50 result.add(new AutofillPaymentApp(webContents)); |
| 53 if (sAdditionalFactory != null) result.addAll(sAdditionalFactory.create(
webContents)); | 51 if (sAdditionalFactory != null) result.addAll(sAdditionalFactory.create(
webContents)); |
| 54 return result; | 52 return result; |
| 55 } | 53 } |
| 56 } | 54 } |
| OLD | NEW |