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

Unified Diff: components/autofill/core/browser/personal_data_manager.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
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 0bf835169f1f913f0444bf0c3361db8dac00da95..aa1658bc9ca4a56fa1e79e7a7af7d3b13bf84c94 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1123,7 +1123,7 @@ void PersonalDataManager::LoadProfiles() {
CancelPendingQuery(&pending_server_profiles_query_);
pending_profiles_query_ = database_->GetAutofillProfiles(this);
- pending_server_profiles_query_ = database_->GetAutofillServerProfiles(this);
+ pending_server_profiles_query_ = database_->GetServerProfiles(this);
}
// Win, Linux, Android and iOS implementations do nothing. Mac implementation
@@ -1164,12 +1164,16 @@ std::string PersonalDataManager::SaveImportedProfile(
return std::string();
// Don't save a web profile if the data in the profile is a subset of an
- // auxiliary profile.
- for (std::vector<AutofillProfile*>::const_iterator iter =
- auxiliary_profiles_.begin();
- iter != auxiliary_profiles_.end(); ++iter) {
- if (imported_profile.IsSubsetOf(**iter, app_locale_))
- return (*iter)->guid();
+ // auxiliary profile...
+ for (AutofillProfile* profile : auxiliary_profiles_) {
+ if (imported_profile.IsSubsetOf(*profile, app_locale_))
+ return profile->guid();
+ }
+
+ // ...or server profile.
+ for (AutofillProfile* profile : server_profiles_) {
+ if (imported_profile.IsSubsetOf(*profile, app_locale_))
+ return profile->guid();
}
std::vector<AutofillProfile> profiles;

Powered by Google App Engine
This is Rietveld 408576698