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

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

Issue 1989173005: [Autofill] Dedupe similar profiles on insertion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments 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/autofill_profile.cc
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index 0f69602a9265b7a33035cbcbb7552847a1b150ad..888837994451dd0d005ea37d48611e554b20e25c 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -431,9 +431,15 @@ bool AutofillProfile::operator!=(const AutofillProfile& profile) const {
return !operator==(profile);
}
-const base::string16 AutofillProfile::PrimaryValue() const {
- return GetRawInfo(NAME_FIRST) + GetRawInfo(NAME_LAST) +
- GetRawInfo(ADDRESS_HOME_LINE1) + GetRawInfo(ADDRESS_HOME_CITY);
+const base::string16 AutofillProfile::PrimaryValue(
+ const std::string& app_locale) const {
+ std::vector<base::string16> primary_values{
+ GetInfo(AutofillType(NAME_FIRST), app_locale),
+ GetInfo(AutofillType(NAME_LAST), app_locale),
+ GetInfo(AutofillType(ADDRESS_HOME_LINE1), app_locale),
+ GetInfo(AutofillType(ADDRESS_HOME_CITY), app_locale)};
+ return CanonicalizeProfileString(
+ base::JoinString(primary_values, base::UTF8ToUTF16(" ")));
}
bool AutofillProfile::IsSubsetOf(const AutofillProfile& profile,
« no previous file with comments | « components/autofill/core/browser/autofill_profile.h ('k') | components/autofill/core/browser/autofill_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698