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

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: 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..bf494665f6fcb18895e3ef39bcd6dba52c79e812 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -432,8 +432,12 @@ bool AutofillProfile::operator!=(const AutofillProfile& profile) const {
}
const base::string16 AutofillProfile::PrimaryValue() const {
- return GetRawInfo(NAME_FIRST) + GetRawInfo(NAME_LAST) +
- GetRawInfo(ADDRESS_HOME_LINE1) + GetRawInfo(ADDRESS_HOME_CITY);
+ std::vector<std::string> primary_values{
+ base::UTF16ToUTF8(GetRawInfo(NAME_FIRST)),
+ base::UTF16ToUTF8(GetRawInfo(NAME_LAST)),
+ base::UTF16ToUTF8(GetRawInfo(ADDRESS_HOME_LINE1)),
+ base::UTF16ToUTF8(GetRawInfo(ADDRESS_HOME_CITY))};
Roger McFarlane (Chromium) 2016/06/08 18:55:38 GetInfo() instead of GetRawInfo()?
sebsg 2016/06/08 21:58:46 Done.
+ return base::UTF8ToUTF16(base::JoinString(primary_values, " "));
Mathieu 2016/06/08 18:32:24 can't you use the string16 version of JoinString?
sebsg 2016/06/08 21:58:46 Done.
}
bool AutofillProfile::IsSubsetOf(const AutofillProfile& profile,

Powered by Google App Engine
This is Rietveld 408576698