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

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

Issue 1926553002: Prompt for expiration date for local cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. 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
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 f9e44afb86d3849c5ebab32c67a329270b5f9d62..3b2382fc20641c5b49ab20b234fb5017f2d64709 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -786,6 +786,18 @@ bool CreditCard::IsExpired(const base::Time& current_time) const {
current_time);
}
+bool CreditCard::ShouldUpdateExpiration(const base::Time& current_time) const {
+ switch (record_type()) {
+ case LOCAL_CARD:
+ return IsExpired(current_time);
+ case MASKED_SERVER_CARD:
+ case FULL_SERVER_CARD:
+ return server_status_ == EXPIRED || IsExpired(current_time);
Mathieu 2016/04/27 19:54:50 looks like this function could be replaced with r
please use gerrit instead 2016/04/28 00:30:24 Done.
+ }
+ NOTREACHED();
+ return false;
+}
+
// So we can compare CreditCards with EXPECT_EQ().
std::ostream& operator<<(std::ostream& os, const CreditCard& credit_card) {
return os << base::UTF16ToUTF8(credit_card.Label()) << " "

Powered by Google App Engine
This is Rietveld 408576698