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

Unified Diff: components/autofill/core/browser/credit_card_field.h

Issue 493393003: [Autofill] Autofill incorrectly fills credit card expiration year in 2-digit fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments and code indentation. Created 6 years, 4 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 | « no previous file | components/autofill/core/browser/credit_card_field.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/credit_card_field.h
diff --git a/components/autofill/core/browser/credit_card_field.h b/components/autofill/core/browser/credit_card_field.h
index bf45e7ee6efb0194481158448104546b07e9ff85..64fa4edc941f65057427305c90a025d65b0191bb 100644
--- a/components/autofill/core/browser/credit_card_field.h
+++ b/components/autofill/core/browser/credit_card_field.h
@@ -31,12 +31,17 @@ class CreditCardField : public FormField {
CreditCardField();
+ // For the combined expiration field we return |exp_year_type_|; otherwise if
+ // |expiration_year_| is having year with |max_length| of 2-digits we return
+ // |CREDIT_CARD_EXP_2_DIGIT_YEAR|; otherwise |CREDIT_CARD_EXP_4_DIGIT_YEAR|.
+ ServerFieldType GetExpirationYearType() const;
+
const AutofillField* cardholder_; // Optional.
// Occasionally pages have separate fields for the cardholder's first and
- // last names; for such pages cardholder_ holds the first name field and
+ // last names; for such pages |cardholder_| holds the first name field and
// we store the last name field here.
- // (We could store an embedded NameField object here, but we don't do so
+ // (We could store an embedded |NameField| object here, but we don't do so
// because the text patterns for matching a cardholder name are different
// than for ordinary names, and because cardholder names never have titles,
// middle names or suffixes.)
@@ -55,9 +60,10 @@ class CreditCardField : public FormField {
const AutofillField* expiration_year_;
const AutofillField* expiration_date_;
- // True if the year is detected to be a 2-digit year; otherwise, we assume
- // a 4-digit year.
- bool is_two_digit_year_;
+ // For combined expiration field having year as 2-digits we store here
+ // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store
+ // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|.
+ ServerFieldType exp_year_type_;
DISALLOW_COPY_AND_ASSIGN(CreditCardField);
};
« no previous file with comments | « no previous file | components/autofill/core/browser/credit_card_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698