| Index: components/autofill/core/browser/autofill_manager.cc
|
| diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
|
| index 6f4908cecc766c1c9e6ea251ddb3d18737f7e9c7..ac9695dc1376f07a7ac5d1262ec52f82c9141279 100644
|
| --- a/components/autofill/core/browser/autofill_manager.cc
|
| +++ b/components/autofill/core/browser/autofill_manager.cc
|
| @@ -174,6 +174,14 @@ void SelectRightNameType(const ServerFieldTypeSet& old_types,
|
| }
|
| }
|
|
|
| +bool IsCreditCardExpirationType(ServerFieldType type) {
|
| + return type == CREDIT_CARD_EXP_MONTH ||
|
| + type == CREDIT_CARD_EXP_2_DIGIT_YEAR ||
|
| + type == CREDIT_CARD_EXP_4_DIGIT_YEAR ||
|
| + type == CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR ||
|
| + type == CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR;
|
| +}
|
| +
|
| } // namespace
|
|
|
| AutofillManager::AutofillManager(
|
| @@ -1450,6 +1458,12 @@ void AutofillManager::FillOrPreviewDataModelForm(
|
| // should be non-empty and vice versa.
|
| value = unmask_request_.user_response.cvc;
|
| DCHECK_EQ(&unmask_request_.card == &data_model, !value.empty());
|
| + } else if (is_credit_card && IsCreditCardExpirationType(
|
| + cached_field->Type().GetStorableType()) &&
|
| + static_cast<const CreditCard*>(&data_model)
|
| + ->IsExpired(base::Time::Now())) {
|
| + // Don't fill expired cards expiration date.
|
| + value = base::string16();
|
| }
|
|
|
| // Must match ForEachMatchingFormField() in form_autofill_util.cc.
|
|
|