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

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

Issue 884843002: Recording in UMA when a user interacted with an address form or a credit card form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing test_personal_data_manager. Created 5 years, 11 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 911d07b047e83d2ac6d69f1d03bf8669db355f20..53e75de3b0c77542f8b4806a3f2cd5a221bfe2d1 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1197,21 +1197,25 @@ void PersonalDataManager::EnabledPrefChanged() {
const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles(
bool record_metrics) const {
#if defined(OS_MACOSX) && !defined(OS_IOS)
- if (!pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook))
- return web_profiles();
+ bool use_auxiliary_profiles =
+ pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook);
#else
- if (!pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled))
- return web_profiles();
+ bool use_auxiliary_profiles =
+ pref_service_->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled);
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
profiles_.clear();
// Populates |auxiliary_profiles_|.
- LoadAuxiliaryProfiles(record_metrics);
+ if (use_auxiliary_profiles)
+ LoadAuxiliaryProfiles(record_metrics);
profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end());
Evan Stade 2015/02/03 20:02:11 couldn't you fix this by changing these web_profil
Walter Cacau 2015/02/03 20:25:00 Unfortunately this does not work because test_pers
Walter Cacau 2015/02/05 04:00:18 I was wrong. There is no conflict in the profiles_
- profiles_.insert(
- profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end());
+ if (use_auxiliary_profiles) {
+ profiles_.insert(
+ profiles_.end(), auxiliary_profiles_.begin(),
+ auxiliary_profiles_.end());
+ }
profiles_.insert(
profiles_.end(), server_profiles_.begin(), server_profiles_.end());
return profiles_;

Powered by Google App Engine
This is Rietveld 408576698