Chromium Code Reviews| 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 CreditCard(); | 58 CreditCard(); |
| 59 CreditCard(const CreditCard& credit_card); | 59 CreditCard(const CreditCard& credit_card); |
| 60 ~CreditCard() override; | 60 ~CreditCard() override; |
| 61 | 61 |
| 62 // Returns a version of |number| that has any separator characters removed. | 62 // Returns a version of |number| that has any separator characters removed. |
| 63 static const base::string16 StripSeparators(const base::string16& number); | 63 static const base::string16 StripSeparators(const base::string16& number); |
| 64 | 64 |
| 65 // The user-visible type of the card, e.g. 'Mastercard'. | 65 // The user-visible type of the card, e.g. 'Mastercard'. |
| 66 static base::string16 TypeForDisplay(const std::string& type); | 66 static base::string16 TypeForDisplay(const std::string& type); |
| 67 | 67 |
| 68 // This method is not compiled on iOS because the resources are not used and | |
| 69 // should not be shipped. | |
| 70 // TODO(jdonnelly): Use credit card issuer images on iOS. | |
|
Justin Donnelly
2016/08/05 18:20:20
Sweet! Now I'm down to 893 TODOs. ;-)
| |
| 71 // http://crbug.com/535784 | |
| 72 #if !defined(OS_IOS) | |
| 73 // The ResourceBundle ID for the appropriate credit card image. | 68 // The ResourceBundle ID for the appropriate credit card image. |
| 74 static int IconResourceId(const std::string& type); | 69 static int IconResourceId(const std::string& type); |
| 75 #endif // #if !defined(OS_IOS) | |
| 76 | 70 |
| 77 // Returns the internal representation of credit card type corresponding to | 71 // Returns the internal representation of credit card type corresponding to |
| 78 // the given |number|. The credit card type is determined purely according to | 72 // the given |number|. The credit card type is determined purely according to |
| 79 // the Issuer Identification Number (IIN), a.k.a. the "Bank Identification | 73 // the Issuer Identification Number (IIN), a.k.a. the "Bank Identification |
| 80 // Number (BIN)", which is parsed from the relevant prefix of the |number|. | 74 // Number (BIN)", which is parsed from the relevant prefix of the |number|. |
| 81 // This function performs no additional validation checks on the |number|. | 75 // This function performs no additional validation checks on the |number|. |
| 82 // Hence, the returned type for both the valid card "4111-1111-1111-1111" and | 76 // Hence, the returned type for both the valid card "4111-1111-1111-1111" and |
| 83 // the invalid card "4garbage" will be Visa, which has an IIN of 4. | 77 // the invalid card "4garbage" will be Visa, which has an IIN of 4. |
| 84 static const char* GetCreditCardType(const base::string16& number); | 78 static const char* GetCreditCardType(const base::string16& number); |
| 85 | 79 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 extern const char kDiscoverCard[]; | 268 extern const char kDiscoverCard[]; |
| 275 extern const char kGenericCard[]; | 269 extern const char kGenericCard[]; |
| 276 extern const char kJCBCard[]; | 270 extern const char kJCBCard[]; |
| 277 extern const char kMasterCard[]; | 271 extern const char kMasterCard[]; |
| 278 extern const char kUnionPay[]; | 272 extern const char kUnionPay[]; |
| 279 extern const char kVisaCard[]; | 273 extern const char kVisaCard[]; |
| 280 | 274 |
| 281 } // namespace autofill | 275 } // namespace autofill |
| 282 | 276 |
| 283 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 277 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
| OLD | NEW |