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

Unified Diff: components/autofill/core/browser/personal_data_manager.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: Add docs 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
Index: components/autofill/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index de07d8dae277a4c7989a98b772cce3b9ec79a374..2e3dd1238285f6fac48c8c9959070f3b52818048 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -259,7 +259,8 @@ bool PersonalDataManager::ImportFormData(
continue;
AutofillType field_type = field->Type();
- NativeFieldType native_field_type = field_type.native_type();
+ NativeFieldType native_field_type =
+ field_type.GetApproximateNativeFieldType();
FieldTypeGroup group(field_type.group());
// There can be multiple email fields (e.g. in the case of 'confirm email'
@@ -617,8 +618,7 @@ void PersonalDataManager::GetProfileSuggestions(
// Phone numbers could be split in US forms, so field value could be
// either prefix or suffix of the phone.
bool matched_phones = false;
- if ((type.native_type() == PHONE_HOME_NUMBER ||
- type.native_type() == PHONE_BILLING_NUMBER) &&
+ if (type.GetEquivalentNativeType() == PHONE_HOME_NUMBER &&
!field_value_lower_case.empty() &&
profile_value_lower_case.find(field_value_lower_case) !=
base::string16::npos) {
@@ -646,7 +646,7 @@ void PersonalDataManager::GetProfileSuggestions(
if (!field_is_autofilled) {
AutofillProfile::CreateInferredLabels(
&matched_profiles, &other_field_types,
- type.native_type(), 1, labels);
+ type.GetApproximateNativeFieldType(), 1, labels);
} else {
// No sub-labels for previously filled fields.
labels->resize(values->size());
@@ -678,7 +678,7 @@ void PersonalDataManager::GetCreditCardSuggestions(
credit_card->GetInfo(type, app_locale_);
if (!creditcard_field_value.empty() &&
StartsWith(creditcard_field_value, field_contents, false)) {
- if (type.native_type() == CREDIT_CARD_NUMBER)
+ if (type.GetEquivalentNativeType() == CREDIT_CARD_NUMBER)
creditcard_field_value = credit_card->ObfuscatedNumber();
base::string16 label;

Powered by Google App Engine
This is Rietveld 408576698