| Index: components/autofill/core/browser/credit_card.cc
|
| diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
|
| index 649a81267fc9bc2b1cbda27b5c1cb4fb45857f53..d0e56c2cf4299b2a55817e1599cb03d6ba233641 100644
|
| --- a/components/autofill/core/browser/credit_card.cc
|
| +++ b/components/autofill/core/browser/credit_card.cc
|
| @@ -647,6 +647,16 @@ bool CreditCard::IsValid() const {
|
| expiration_year_, expiration_month_, base::Time::Now());
|
| }
|
|
|
| +bool CreditCard::IsExpired(base::Time::Exploded time) const {
|
| + // Credit cards with no saved expiration are never considered expired.
|
| + if (expiration_month_ == 0 && expiration_year_ == 0)
|
| + return false;
|
| +
|
| + // Credit cards expire at the end of the specified month.
|
| + return expiration_year_ < time.year ||
|
| + (expiration_year_ == time.year && expiration_month_ < time.month);
|
| +}
|
| +
|
| void CreditCard::GetSupportedTypes(ServerFieldTypeSet* supported_types) const {
|
| supported_types->insert(CREDIT_CARD_NAME_FULL);
|
| supported_types->insert(CREDIT_CARD_NAME_FIRST);
|
|
|