Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 1885773002: [Autofill] Don't fill expiration date of expired credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/credit_card.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index 08afb7e35e4ea83f55eb8bebdaf31af1629f0244..9a0423c19a6fc25bf4678a19f7a856d0f109bf56 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -807,12 +807,9 @@ std::vector<Suggestion> PersonalDataManager::GetCreditCardSuggestions(
base::Time comparison_time = base::Time::Now();
cards_to_suggest.sort(
[comparison_time](const CreditCard* a, const CreditCard* b) {
- bool a_has_valid_expiration = IsValidCreditCardExpirationDate(
- a->expiration_year(), a->expiration_month(), comparison_time);
- if (a_has_valid_expiration !=
- IsValidCreditCardExpirationDate(
- b->expiration_year(), b->expiration_month(), comparison_time))
- return a_has_valid_expiration;
+ bool a_is_expired = a->IsExpired(comparison_time);
+ if (a_is_expired != b->IsExpired(comparison_time))
+ return !a_is_expired;
return a->CompareFrecency(b, comparison_time);
});
« no previous file with comments | « components/autofill/core/browser/credit_card.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698