Commit a619d17d authored by waltercacau's avatar waltercacau Committed by Commit bot

Pass origin as a parameter to PaymentApp#getInstruments

This will be needed by new changes to some of the existing PaymentApp
implementations.

BUG=674369

Review-Url: https://codereview.chromium.org/2565143002
Cr-Commit-Position: refs/heads/master@{#440786}
parent 26b1599b
......@@ -39,8 +39,8 @@ public class AutofillPaymentApp implements PaymentApp {
}
@Override
public void getInstruments(
Map<String, PaymentMethodData> unusedMethodData, final InstrumentsCallback callback) {
public void getInstruments(Map<String, PaymentMethodData> unusedMethodData, String unusedOrigin,
final InstrumentsCallback callback) {
PersonalDataManager pdm = PersonalDataManager.getInstance();
List<CreditCard> cards = pdm.getCreditCardsToSuggest();
final List<PaymentInstrument> instruments = new ArrayList<>(cards.size());
......
......@@ -36,9 +36,11 @@ public interface PaymentApp {
* @param methodData The map from methods to method specific data. The data contains such
* information as whether the app should be invoked in test or production
* mode, merchant identifier, or a public key.
* @param origin The origin of this merchant.
* @param callback The object that will receive the list of instruments.
*/
void getInstruments(Map<String, PaymentMethodData> methodData, InstrumentsCallback callback);
void getInstruments(
Map<String, PaymentMethodData> methodData, String origin, InstrumentsCallback callback);
/**
* Returns a list of all payment method names that this app supports. For example, ["visa",
......
......@@ -581,7 +581,7 @@ public class PaymentRequestImpl
// so a fast response from a non-autofill payment app at the front of the app list does not
// cause NOT_SUPPORTED payment rejection.
for (Map.Entry<PaymentApp, Map<String, PaymentMethodData>> q : queryApps.entrySet()) {
q.getKey().getInstruments(q.getValue(), this);
q.getKey().getInstruments(q.getValue(), mOrigin, this);
}
}
......
......@@ -49,8 +49,7 @@ public class ServiceWorkerPaymentApp implements PaymentApp {
}
@Override
public void getInstruments(
Map<String, PaymentMethodData> unusedMethodData,
public void getInstruments(Map<String, PaymentMethodData> unusedMethodData, String unusedOrigin,
final InstrumentsCallback callback) {
final List<PaymentInstrument> instruments =
new ArrayList<PaymentInstrument>();
......
......@@ -889,7 +889,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT
}
@Override
public void getInstruments(Map<String, PaymentMethodData> methodData,
public void getInstruments(Map<String, PaymentMethodData> methodData, String origin,
InstrumentsCallback instrumentsCallback) {
mCallback = instrumentsCallback;
respond();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment