| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // The user-visible issuer network of the card, e.g. 'Mastercard'. | 208 // The user-visible issuer network of the card, e.g. 'Mastercard'. |
| 209 base::string16 NetworkForDisplay() const; | 209 base::string16 NetworkForDisplay() const; |
| 210 // A label for this card formatted as 'IssuerNetwork - 2345'. | 210 // A label for this card formatted as 'IssuerNetwork - 2345'. |
| 211 base::string16 NetworkAndLastFourDigits() const; | 211 base::string16 NetworkAndLastFourDigits() const; |
| 212 // Localized expiration for this card formatted as 'Exp: 06/17'. | 212 // Localized expiration for this card formatted as 'Exp: 06/17'. |
| 213 base::string16 AbbreviatedExpirationDateForDisplay() const; | 213 base::string16 AbbreviatedExpirationDateForDisplay() const; |
| 214 // Returns the date when the card was last used in autofill. | 214 // Returns the date when the card was last used in autofill. |
| 215 base::string16 GetLastUsedDateForDisplay(const std::string& app_locale) const; | 215 base::string16 GetLastUsedDateForDisplay(const std::string& app_locale) const; |
| 216 // Formatted expiration date (e.g., 05/2020). | 216 // Formatted expiration date (e.g., 05/2020). |
| 217 base::string16 ExpirationDateForDisplay() const; | 217 base::string16 ExpirationDateForDisplay() const; |
| 218 // Expiration functions. |
| 219 base::string16 ExpirationMonthAsString() const; |
| 220 base::string16 Expiration4DigitYearAsString() const; |
| 218 | 221 |
| 219 private: | 222 private: |
| 220 FRIEND_TEST_ALL_PREFIXES(CreditCardTest, SetExpirationDateFromString); | 223 FRIEND_TEST_ALL_PREFIXES(CreditCardTest, SetExpirationDateFromString); |
| 221 FRIEND_TEST_ALL_PREFIXES(CreditCardTest, SetExpirationYearFromString); | 224 FRIEND_TEST_ALL_PREFIXES(CreditCardTest, SetExpirationYearFromString); |
| 222 | 225 |
| 223 // Private display functions. | |
| 224 base::string16 ExpirationMonthAsString() const; | |
| 225 base::string16 Expiration4DigitYearAsString() const; | |
| 226 base::string16 Expiration2DigitYearAsString() const; | 226 base::string16 Expiration2DigitYearAsString() const; |
| 227 | 227 |
| 228 // FormGroup: | 228 // FormGroup: |
| 229 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; | 229 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; |
| 230 | 230 |
| 231 // The issuer network of the card to fill in to the page, e.g. 'Mastercard'. | 231 // The issuer network of the card to fill in to the page, e.g. 'Mastercard'. |
| 232 base::string16 NetworkForFill() const; | 232 base::string16 NetworkForFill() const; |
| 233 | 233 |
| 234 // The month and year are zero if not present. | 234 // The month and year are zero if not present. |
| 235 int Expiration4DigitYear() const { return expiration_year_; } | 235 int Expiration4DigitYear() const { return expiration_year_; } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 extern const char kGenericCard[]; | 275 extern const char kGenericCard[]; |
| 276 extern const char kJCBCard[]; | 276 extern const char kJCBCard[]; |
| 277 extern const char kMasterCard[]; | 277 extern const char kMasterCard[]; |
| 278 extern const char kMirCard[]; | 278 extern const char kMirCard[]; |
| 279 extern const char kUnionPay[]; | 279 extern const char kUnionPay[]; |
| 280 extern const char kVisaCard[]; | 280 extern const char kVisaCard[]; |
| 281 | 281 |
| 282 } // namespace autofill | 282 } // namespace autofill |
| 283 | 283 |
| 284 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 284 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
| OLD | NEW |