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; | 7 import android.content.Context; |
8 import android.os.Handler; | 8 import android.os.Handler; |
9 import android.text.TextUtils; | 9 import android.text.TextUtils; |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 * @param context The context. | 39 * @param context The context. |
40 * @param webContents The web contents where PaymentRequest was invoked. | 40 * @param webContents The web contents where PaymentRequest was invoked. |
41 */ | 41 */ |
42 public AutofillPaymentApp(Context context, WebContents webContents) { | 42 public AutofillPaymentApp(Context context, WebContents webContents) { |
43 mContext = context; | 43 mContext = context; |
44 mWebContents = webContents; | 44 mWebContents = webContents; |
45 } | 45 } |
46 | 46 |
47 @Override | 47 @Override |
48 public void getInstruments(Map<String, PaymentMethodData> methodDataMap, Str
ing unusedOrigin, | 48 public void getInstruments(Map<String, PaymentMethodData> methodDataMap, Str
ing unusedOrigin, |
49 final InstrumentsCallback callback) { | 49 byte[][] unusedCertificateChain, final InstrumentsCallback callback)
{ |
50 PersonalDataManager pdm = PersonalDataManager.getInstance(); | 50 PersonalDataManager pdm = PersonalDataManager.getInstance(); |
51 List<CreditCard> cards = pdm.getCreditCardsToSuggest(); | 51 List<CreditCard> cards = pdm.getCreditCardsToSuggest(); |
52 final List<PaymentInstrument> instruments = new ArrayList<>(cards.size()
); | 52 final List<PaymentInstrument> instruments = new ArrayList<>(cards.size()
); |
53 | 53 |
54 Set<String> basicCardSupportedNetworks = | 54 Set<String> basicCardSupportedNetworks = |
55 convertBasicCardToNetworks(methodDataMap.get(BASIC_CARD_METHOD_N
AME)); | 55 convertBasicCardToNetworks(methodDataMap.get(BASIC_CARD_METHOD_N
AME)); |
56 | 56 |
57 for (int i = 0; i < cards.size(); i++) { | 57 for (int i = 0; i < cards.size(); i++) { |
58 CreditCard card = cards.get(i); | 58 CreditCard card = cards.get(i); |
59 AutofillProfile billingAddress = TextUtils.isEmpty(card.getBillingAd
dressId()) | 59 AutofillProfile billingAddress = TextUtils.isEmpty(card.getBillingAd
dressId()) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 Set<String> methodNames = new HashSet<>(methodDataMap.keySet()); | 162 Set<String> methodNames = new HashSet<>(methodDataMap.keySet()); |
163 methodNames.retainAll(getNetworks().values()); | 163 methodNames.retainAll(getNetworks().values()); |
164 return !methodNames.isEmpty(); | 164 return !methodNames.isEmpty(); |
165 } | 165 } |
166 | 166 |
167 @Override | 167 @Override |
168 public String getAppIdentifier() { | 168 public String getAppIdentifier() { |
169 return "Chrome_Autofill_Payment_App"; | 169 return "Chrome_Autofill_Payment_App"; |
170 } | 170 } |
171 } | 171 } |
OLD | NEW |