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

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

Issue 969103003: Don't save duplicates of wallet addresses to local Autofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make test work Created 5 years, 10 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 | « no previous file | components/autofill/core/browser/personal_data_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9b6504e51ecaec5699474e90de6b52e4b4ea0d90..8b96c6549e3337a09a2572cec7bd4d2c826bd8a4 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -567,28 +567,26 @@ bool AutofillProfile::IsSubsetOf(const AutofillProfile& profile,
ServerFieldTypeSet types;
GetNonEmptyTypes(app_locale, &types);
- for (ServerFieldTypeSet::const_iterator it = types.begin(); it != types.end();
- ++it) {
- if (*it == NAME_FULL || *it == ADDRESS_HOME_STREET_ADDRESS) {
+ for (ServerFieldType type : types) {
+ if (type == NAME_FULL || type == ADDRESS_HOME_STREET_ADDRESS) {
// Ignore the compound "full name" field type. We are only interested in
// comparing the constituent parts. For example, if |this| has a middle
// name saved, but |profile| lacks one, |profile| could still be a subset
// of |this|. Likewise, ignore the compound "street address" type, as we
// are only interested in matching line-by-line.
continue;
- } else if (AutofillType(*it).group() == PHONE_HOME) {
+ } else if (AutofillType(type).group() == PHONE_HOME) {
// Phone numbers should be canonicalized prior to being compared.
- if (*it != PHONE_HOME_WHOLE_NUMBER) {
+ if (type != PHONE_HOME_WHOLE_NUMBER) {
continue;
} else if (!i18n::PhoneNumbersMatch(
- GetRawInfo(*it),
- profile.GetRawInfo(*it),
- base::UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)),
- app_locale)) {
+ GetRawInfo(type), profile.GetRawInfo(type),
+ base::UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)),
+ app_locale)) {
return false;
}
- } else if (base::StringToLowerASCII(GetRawInfo(*it)) !=
- base::StringToLowerASCII(profile.GetRawInfo(*it))) {
+ } else if (base::StringToLowerASCII(GetRawInfo(type)) !=
+ base::StringToLowerASCII(profile.GetRawInfo(type))) {
return false;
}
}
« no previous file with comments | « no previous file | components/autofill/core/browser/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698