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

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

Issue 22040002: [Autofill] Add a separate enumeration for HTML field type hints. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser test Created 7 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 | « components/autofill/core/browser/contact_info.cc ('k') | components/autofill/core/browser/field_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e627207388811a22725b0eae45a3f1a05bf48466..f3ac6b112ab976ea2ec39b67900a95d04e4d5e8b 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -371,22 +371,23 @@ void CreditCard::SetRawInfo(ServerFieldType type,
base::string16 CreditCard::GetInfo(const AutofillType& type,
const std::string& app_locale) const {
- if (type.server_type() == CREDIT_CARD_NUMBER)
+ ServerFieldType storable_type = type.GetStorableType();
+ if (storable_type == CREDIT_CARD_NUMBER)
return StripSeparators(number_);
- return GetRawInfo(type.server_type());
+ return GetRawInfo(storable_type);
}
bool CreditCard::SetInfo(const AutofillType& type,
const base::string16& value,
const std::string& app_locale) {
- ServerFieldType server_type = type.server_type();
- if (server_type == CREDIT_CARD_NUMBER)
- SetRawInfo(server_type, StripSeparators(value));
- else if (server_type == CREDIT_CARD_EXP_MONTH)
+ ServerFieldType storable_type = type.GetStorableType();
+ if (storable_type == CREDIT_CARD_NUMBER)
+ SetRawInfo(storable_type, StripSeparators(value));
+ else if (storable_type == CREDIT_CARD_EXP_MONTH)
SetExpirationMonthFromString(value, app_locale);
else
- SetRawInfo(server_type, value);
+ SetRawInfo(storable_type, value);
return true;
}
« no previous file with comments | « components/autofill/core/browser/contact_info.cc ('k') | components/autofill/core/browser/field_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698