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

Unified Diff: chrome/browser/autofill/credit_card.cc

Issue 6931029: Set datapresent string to contain precisely those field types available in stored Autofill data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OVERRIDE FTW Created 9 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: chrome/browser/autofill/credit_card.cc
diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc
index 4018fe424b7db03e43e20687dde58f19f15b2aa4..037c8207203c41897cd8295f6500c7f9dc3bbe4e 100644
--- a/chrome/browser/autofill/credit_card.cc
+++ b/chrome/browser/autofill/credit_card.cc
@@ -173,6 +173,12 @@ void CreditCard::GetPossibleFieldTypes(const string16& text,
if (Is4DigitExpirationYear(text))
possible_types->insert(CREDIT_CARD_EXP_4_DIGIT_YEAR);
+
+ if (text == GetInfo(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR))
+ possible_types->insert(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR);
+
+ if (text == GetInfo(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR))
+ possible_types->insert(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR);
}
void CreditCard::GetAvailableFieldTypes(FieldTypeSet* available_types) const {
@@ -192,6 +198,12 @@ void CreditCard::GetAvailableFieldTypes(FieldTypeSet* available_types) const {
if (!Expiration4DigitYearAsString().empty())
available_types->insert(CREDIT_CARD_EXP_4_DIGIT_YEAR);
+
+ if (!GetInfo(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR).empty())
+ available_types->insert(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR);
+
+ if (!GetInfo(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR).empty())
+ available_types->insert(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR);
}
string16 CreditCard::GetInfo(AutofillFieldType type) const {

Powered by Google App Engine
This is Rietveld 408576698