Commit 87d3589b authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Chromium LUCI CQ

[WebLayer] Remove isServerAutofillInstrument

Context:
isServerAutofillInstrument, mHideServerAutofillCards are not being used
and so should be removed. This will make a less complicated
BrowserPaymentRequest#notifyPaymentUiOfPendingApps because pendingApps
is no longer filtered.

Changes:
* Removed the related code of isServerAutofillInstrument.
* Removed the related code of mHideServerAutofillCards.

Bug: 1025619
Change-Id: I2b836226802cbaa2e464f8f1c94d59fbba4b848d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2565450
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarNick Burris <nburris@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832352}
parent 5862cd8f
......@@ -118,11 +118,6 @@ public class AutofillPaymentInstrument
return true;
}
@Override
public boolean isServerAutofillInstrument() {
return !mCard.getIsLocal();
}
@Override
public boolean isValidForPaymentMethodData(String method, PaymentMethodData data) {
boolean isSupportedMethod = super.isValidForPaymentMethodData(method, data);
......
......@@ -52,7 +52,6 @@ import org.chromium.payments.mojom.PaymentResponse;
import org.chromium.payments.mojom.PaymentValidationErrors;
import org.chromium.url.GURL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
......@@ -81,7 +80,6 @@ public class ChromePaymentRequestService
private boolean mHasClosed;
private PaymentRequestSpec mSpec;
private boolean mHideServerAutofillCards;
private PaymentHandlerHost mPaymentHandlerHost;
/**
......@@ -581,24 +579,12 @@ public class ChromePaymentRequestService
// Implements BrowserPaymentRequest:
@Override
public void onPaymentAppCreated(PaymentApp paymentApp) {
mHideServerAutofillCards |= paymentApp.isServerAutofillInstrumentReplacement();
paymentApp.setHaveRequestedAutofillData(mPaymentUiService.haveRequestedAutofillData());
}
// Implements BrowserPaymentRequest:
@Override
public void notifyPaymentUiOfPendingApps(List<PaymentApp> pendingApps) {
if (mHideServerAutofillCards) {
List<PaymentApp> nonServerAutofillCards = new ArrayList<>();
int numberOfPendingApps = pendingApps.size();
for (int i = 0; i < numberOfPendingApps; i++) {
if (!pendingApps.get(i).isServerAutofillInstrument()) {
nonServerAutofillCards.add(pendingApps.get(i));
}
}
pendingApps = nonServerAutofillCards;
}
// Load the validation rules for each unique region code in the credit card billing
// addresses and check for validity.
Set<String> uniqueCountryCodes = new HashSet<>();
......
......@@ -106,20 +106,6 @@ public abstract class PaymentApp extends EditableOption {
return false;
}
/** @return Whether this is a server autofill app. */
public boolean isServerAutofillInstrument() {
return false;
}
/**
* @return Whether this is a replacement for all server autofill apps. If at least one of
* the displayed apps returns true here, then all apps that return true in
* isServerAutofillInstrument() should be hidden.
*/
public boolean isServerAutofillInstrumentReplacement() {
return false;
}
/**
* @return Whether the app supports the payment method with the method data. For example,
* supported card types and networks in the data should be verified for 'basic-card'
......
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