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

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: Signed and delivered Created 9 years, 7 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 | « chrome/browser/autofill/autofill_merge_unittest.cc ('k') | chrome/browser/autofill/form_structure.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..224719dcdf587a6c50bcf36c655fd80ed45f4293 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 {
@@ -259,6 +271,14 @@ void CreditCard::SetInfo(AutofillFieldType type, const string16& value) {
SetExpirationYearFromString(value);
break;
+ case CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR:
+ // This is a read-only attribute.
+ break;
+
+ case CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR:
+ // This is a read-only attribute.
+ break;
+
case CREDIT_CARD_TYPE:
// We determine the type based on the number.
break;
« no previous file with comments | « chrome/browser/autofill/autofill_merge_unittest.cc ('k') | chrome/browser/autofill/form_structure.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698