| 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.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Intent; | 8 import android.content.Intent; |
| 9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 (AutofillPaymentInstrument) mPendingAutofillInstruments.get(
i); | 1225 (AutofillPaymentInstrument) mPendingAutofillInstruments.get(
i); |
| 1226 | 1226 |
| 1227 String countryCode = AutofillAddress.getCountryCode(creditCard.getBi
llingAddress()); | 1227 String countryCode = AutofillAddress.getCountryCode(creditCard.getBi
llingAddress()); |
| 1228 if (!uniqueCountryCodes.contains(countryCode)) { | 1228 if (!uniqueCountryCodes.contains(countryCode)) { |
| 1229 uniqueCountryCodes.add(countryCode); | 1229 uniqueCountryCodes.add(countryCode); |
| 1230 PersonalDataManager.getInstance().loadRulesForRegion(countryCode
); | 1230 PersonalDataManager.getInstance().loadRulesForRegion(countryCode
); |
| 1231 } | 1231 } |
| 1232 | 1232 |
| 1233 // If there's a card on file with a valid number and a name, then | 1233 // If there's a card on file with a valid number and a name, then |
| 1234 // PaymentRequest.canMakePayment() returns true. | 1234 // PaymentRequest.canMakePayment() returns true. |
| 1235 mCanMakePayment |= creditCard.isValid(); | 1235 mCanMakePayment |= creditCard.isValidCard(); |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 // List order: | 1238 // List order: |
| 1239 // > Non-autofill instruments. | 1239 // > Non-autofill instruments. |
| 1240 // > Complete autofill instruments. | 1240 // > Complete autofill instruments. |
| 1241 // > Incomplete autofill instruments. | 1241 // > Incomplete autofill instruments. |
| 1242 Collections.sort(mPendingAutofillInstruments, COMPLETENESS_COMPARATOR); | 1242 Collections.sort(mPendingAutofillInstruments, COMPLETENESS_COMPARATOR); |
| 1243 mPendingInstruments.addAll(mPendingAutofillInstruments); | 1243 mPendingInstruments.addAll(mPendingAutofillInstruments); |
| 1244 | 1244 |
| 1245 // Log the number of suggested credit cards. | 1245 // Log the number of suggested credit cards. |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 "PaymentRequest.CheckoutFunnel.Aborted", abortReason, | 1473 "PaymentRequest.CheckoutFunnel.Aborted", abortReason, |
| 1474 PaymentRequestMetrics.ABORT_REASON_MAX); | 1474 PaymentRequestMetrics.ABORT_REASON_MAX); |
| 1475 | 1475 |
| 1476 if (abortReason == PaymentRequestMetrics.ABORT_REASON_ABORTED_BY_USER) { | 1476 if (abortReason == PaymentRequestMetrics.ABORT_REASON_ABORTED_BY_USER) { |
| 1477 mJourneyLogger.recordJourneyStatsHistograms("UserAborted"); | 1477 mJourneyLogger.recordJourneyStatsHistograms("UserAborted"); |
| 1478 } else { | 1478 } else { |
| 1479 mJourneyLogger.recordJourneyStatsHistograms("OtherAborted"); | 1479 mJourneyLogger.recordJourneyStatsHistograms("OtherAborted"); |
| 1480 } | 1480 } |
| 1481 } | 1481 } |
| 1482 } | 1482 } |
| OLD | NEW |