| 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.os.Handler; | 7 import android.os.Handler; |
| 8 import android.text.TextUtils; | 8 import android.text.TextUtils; |
| 9 | 9 |
| 10 import org.chromium.chrome.browser.autofill.PersonalDataManager; | 10 import org.chromium.chrome.browser.autofill.PersonalDataManager; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 && AutofillAddress.checkAddressCompletionStatus( | 59 && AutofillAddress.checkAddressCompletionStatus( |
| 60 billingAddress, AutofillAddress.IGNORE_PHONE_COMP
LETENESS_CHECK) | 60 billingAddress, AutofillAddress.IGNORE_PHONE_COMP
LETENESS_CHECK) |
| 61 != AutofillAddress.COMPLETE) { | 61 != AutofillAddress.COMPLETE) { |
| 62 billingAddress = null; | 62 billingAddress = null; |
| 63 } | 63 } |
| 64 | 64 |
| 65 if (billingAddress == null) card.setBillingAddressId(null); | 65 if (billingAddress == null) card.setBillingAddressId(null); |
| 66 | 66 |
| 67 String methodName = null; | 67 String methodName = null; |
| 68 if (basicCardSupportedNetworks != null | 68 if (basicCardSupportedNetworks != null |
| 69 && basicCardSupportedNetworks.contains(card.getBasicCardPaym
entType())) { | 69 && basicCardSupportedNetworks.contains(card.getBasicCardIssu
erNetwork())) { |
| 70 methodName = BASIC_CARD_METHOD_NAME; | 70 methodName = BASIC_CARD_METHOD_NAME; |
| 71 } else if (methodDataMap.containsKey(card.getBasicCardPaymentType())
) { | 71 } else if (methodDataMap.containsKey(card.getBasicCardIssuerNetwork(
))) { |
| 72 methodName = card.getBasicCardPaymentType(); | 72 methodName = card.getBasicCardIssuerNetwork(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 if (methodName != null) { | 75 if (methodName != null) { |
| 76 instruments.add(new AutofillPaymentInstrument( | 76 instruments.add(new AutofillPaymentInstrument( |
| 77 mWebContents, card, billingAddress, methodName)); | 77 mWebContents, card, billingAddress, methodName)); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 new Handler().post(new Runnable() { | 81 new Handler().post(new Runnable() { |
| 82 @Override | 82 @Override |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 Set<String> methodNames = new HashSet<>(methodDataMap.keySet()); | 139 Set<String> methodNames = new HashSet<>(methodDataMap.keySet()); |
| 140 methodNames.retainAll(getNetworks().values()); | 140 methodNames.retainAll(getNetworks().values()); |
| 141 return !methodNames.isEmpty(); | 141 return !methodNames.isEmpty(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 @Override | 144 @Override |
| 145 public String getAppIdentifier() { | 145 public String getAppIdentifier() { |
| 146 return "Chrome_Autofill_Payment_App"; | 146 return "Chrome_Autofill_Payment_App"; |
| 147 } | 147 } |
| 148 } | 148 } |
| OLD | NEW |