| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // Returns a version of |number| that has any separator characters removed. | 59 // Returns a version of |number| that has any separator characters removed. |
| 60 static const base::string16 StripSeparators(const base::string16& number); | 60 static const base::string16 StripSeparators(const base::string16& number); |
| 61 | 61 |
| 62 // The user-visible type of the card, e.g. 'Mastercard'. | 62 // The user-visible type of the card, e.g. 'Mastercard'. |
| 63 static base::string16 TypeForDisplay(const std::string& type); | 63 static base::string16 TypeForDisplay(const std::string& type); |
| 64 | 64 |
| 65 // The ResourceBundle ID for the appropriate credit card image. | 65 // The ResourceBundle ID for the appropriate credit card image. |
| 66 static int IconResourceId(const std::string& type); | 66 static int IconResourceId(const std::string& type); |
| 67 | 67 |
| 68 // The ResourceBundle ID for the appropriate credit card image in |
| 69 // PaymentRequest. |
| 70 static int PaymentRequestIconResourceId(const std::string& type); |
| 71 |
| 68 // Returns the internal representation of credit card type corresponding to | 72 // Returns the internal representation of credit card type corresponding to |
| 69 // the given |number|. The credit card type is determined purely according to | 73 // the given |number|. The credit card type is determined purely according to |
| 70 // the Issuer Identification Number (IIN), a.k.a. the "Bank Identification | 74 // the Issuer Identification Number (IIN), a.k.a. the "Bank Identification |
| 71 // Number (BIN)", which is parsed from the relevant prefix of the |number|. | 75 // Number (BIN)", which is parsed from the relevant prefix of the |number|. |
| 72 // This function performs no additional validation checks on the |number|. | 76 // This function performs no additional validation checks on the |number|. |
| 73 // Hence, the returned type for both the valid card "4111-1111-1111-1111" and | 77 // Hence, the returned type for both the valid card "4111-1111-1111-1111" and |
| 74 // the invalid card "4garbage" will be Visa, which has an IIN of 4. | 78 // the invalid card "4garbage" will be Visa, which has an IIN of 4. |
| 75 static const char* GetCreditCardType(const base::string16& number); | 79 static const char* GetCreditCardType(const base::string16& number); |
| 76 | 80 |
| 77 // Type strings are defined at the bottom of this file, e.g. kVisaCard. | 81 // Type strings are defined at the bottom of this file, e.g. kVisaCard. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 extern const char kGenericCard[]; | 270 extern const char kGenericCard[]; |
| 267 extern const char kJCBCard[]; | 271 extern const char kJCBCard[]; |
| 268 extern const char kMasterCard[]; | 272 extern const char kMasterCard[]; |
| 269 extern const char kMirCard[]; | 273 extern const char kMirCard[]; |
| 270 extern const char kUnionPay[]; | 274 extern const char kUnionPay[]; |
| 271 extern const char kVisaCard[]; | 275 extern const char kVisaCard[]; |
| 272 | 276 |
| 273 } // namespace autofill | 277 } // namespace autofill |
| 274 | 278 |
| 275 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 279 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
| OLD | NEW |