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

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

Issue 2110563002: Use AutofillProfileComparator in place of ad-hoc merge logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge
Patch Set: Rebase Created 4 years, 6 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/form_group.cc
diff --git a/components/autofill/core/browser/form_group.cc b/components/autofill/core/browser/form_group.cc
index 993fe6bfc2bebdb6539152eb3fc77f86aa12a078..417f08a9043b10b0fefafe85c51968dbf3b49d3e 100644
--- a/components/autofill/core/browser/form_group.cc
+++ b/components/autofill/core/browser/form_group.cc
@@ -5,6 +5,7 @@
#include "components/autofill/core/browser/form_group.h"
#include "components/autofill/core/browser/autofill_profile.h"
+#include "components/autofill/core/browser/autofill_profile_comparator.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/common/autofill_l10n_util.h"
@@ -18,20 +19,18 @@ void FormGroup::GetMatchingTypes(const base::string16& text,
return;
}
- base::string16 canonicalized_text =
- AutofillProfile::CanonicalizeProfileString(text);
+ AutofillProfileComparator comparator(app_locale);
+ base::string16 canonicalized_text = comparator.NormalizeForComparison(text);
+
if (canonicalized_text.empty())
return;
- // TODO(crbug.com/574086): Investigate whether to use |app_locale| in case
- // insensitive comparisons.
- l10n::CaseInsensitiveCompare compare;
ServerFieldTypeSet types;
GetSupportedTypes(&types);
for (const auto& type : types) {
- if (compare.StringsEqual(canonicalized_text,
- AutofillProfile::CanonicalizeProfileString(
- GetInfo(AutofillType(type), app_locale))))
+ base::string16 candidate_text = comparator.NormalizeForComparison(
+ GetInfo(AutofillType(type), app_locale));
+ if (canonicalized_text == candidate_text)
matching_types->insert(type);
}
}
« no previous file with comments | « components/autofill/core/browser/contact_info.cc ('k') | components/autofill/core/browser/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698