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 #include "components/autofill/core/browser/autofill_data_util.h" | 5 #include "components/autofill/core/browser/autofill_data_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/i18n/char_iterator.h" | 10 #include "base/i18n/char_iterator.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Mappings from Chrome card networks to Payment Request API basic card payment | 26 // Mappings from Chrome card networks to Payment Request API basic card payment |
27 // spec networks and icons. Note that "generic" is not in the spec. | 27 // spec networks and icons. Note that "generic" is not in the spec. |
28 // https://w3c.github.io/webpayments-methods-card/#method-id | 28 // https://w3c.github.io/webpayments-methods-card/#method-id |
29 const PaymentRequestData kPaymentRequestData[]{ | 29 const PaymentRequestData kPaymentRequestData[]{ |
30 {autofill::kAmericanExpressCard, "amex", IDR_AUTOFILL_CC_AMEX, | 30 {autofill::kAmericanExpressCard, "amex", IDR_AUTOFILL_CC_AMEX, |
31 IDS_AUTOFILL_CC_AMEX}, | 31 IDS_AUTOFILL_CC_AMEX}, |
32 {autofill::kDinersCard, "diners", IDR_AUTOFILL_CC_DINERS, | 32 {autofill::kDinersCard, "diners", IDR_AUTOFILL_CC_DINERS, |
33 IDS_AUTOFILL_CC_DINERS}, | 33 IDS_AUTOFILL_CC_DINERS}, |
34 {autofill::kDiscoverCard, "discover", IDR_AUTOFILL_CC_DISCOVER, | 34 {autofill::kDiscoverCard, "discover", IDR_AUTOFILL_CC_DISCOVER, |
35 IDS_AUTOFILL_CC_DISCOVER}, | 35 IDS_AUTOFILL_CC_DISCOVER}, |
| 36 {autofill::kEloCard, "elo", IDR_AUTOFILL_CC_ELO, IDS_AUTOFILL_CC_ELO}, |
36 {autofill::kJCBCard, "jcb", IDR_AUTOFILL_CC_JCB, IDS_AUTOFILL_CC_JCB}, | 37 {autofill::kJCBCard, "jcb", IDR_AUTOFILL_CC_JCB, IDS_AUTOFILL_CC_JCB}, |
37 {autofill::kMasterCard, "mastercard", IDR_AUTOFILL_CC_MASTERCARD, | 38 {autofill::kMasterCard, "mastercard", IDR_AUTOFILL_CC_MASTERCARD, |
38 IDS_AUTOFILL_CC_MASTERCARD}, | 39 IDS_AUTOFILL_CC_MASTERCARD}, |
39 {autofill::kMirCard, "mir", IDR_AUTOFILL_CC_MIR, IDS_AUTOFILL_CC_MIR}, | 40 {autofill::kMirCard, "mir", IDR_AUTOFILL_CC_MIR, IDS_AUTOFILL_CC_MIR}, |
40 {autofill::kUnionPay, "unionpay", IDR_AUTOFILL_CC_UNIONPAY, | 41 {autofill::kUnionPay, "unionpay", IDR_AUTOFILL_CC_UNIONPAY, |
41 IDS_AUTOFILL_CC_UNION_PAY}, | 42 IDS_AUTOFILL_CC_UNION_PAY}, |
42 {autofill::kVisaCard, "visa", IDR_AUTOFILL_CC_VISA, IDS_AUTOFILL_CC_VISA}, | 43 {autofill::kVisaCard, "visa", IDR_AUTOFILL_CC_VISA, IDS_AUTOFILL_CC_VISA}, |
43 }; | 44 }; |
44 const PaymentRequestData kGenericPaymentRequestData = { | 45 const PaymentRequestData kGenericPaymentRequestData = { |
45 autofill::kGenericCard, "generic", IDR_AUTOFILL_CC_GENERIC, | 46 autofill::kGenericCard, "generic", IDR_AUTOFILL_CC_GENERIC, |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 437 |
437 return re2::RE2::FullMatch(country_code, "^[A-Z]{2}$"); | 438 return re2::RE2::FullMatch(country_code, "^[A-Z]{2}$"); |
438 } | 439 } |
439 | 440 |
440 bool IsValidCountryCode(const base::string16& country_code) { | 441 bool IsValidCountryCode(const base::string16& country_code) { |
441 return IsValidCountryCode(base::UTF16ToUTF8(country_code)); | 442 return IsValidCountryCode(base::UTF16ToUTF8(country_code)); |
442 } | 443 } |
443 | 444 |
444 } // namespace data_util | 445 } // namespace data_util |
445 } // namespace autofill | 446 } // namespace autofill |
OLD | NEW |