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

Side by Side Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 1392623002: [Autofill] Add metric for profile action on form submitted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/core/browser/personal_data_manager.h" 5 #include "components/autofill/core/browser/personal_data_manager.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/i18n/timezone.h" 8 #include "base/i18n/timezone.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 // whereas verified profiles should only ever be overwritten by verified 1051 // whereas verified profiles should only ever be overwritten by verified
1052 // data. If an automatically aggregated profile would overwrite a 1052 // data. If an automatically aggregated profile would overwrite a
1053 // verified profile, just drop it. 1053 // verified profile, just drop it.
1054 matching_profile_found = true; 1054 matching_profile_found = true;
1055 guid = existing_profile->guid(); 1055 guid = existing_profile->guid();
1056 } 1056 }
1057 merged_profiles->push_back(*existing_profile); 1057 merged_profiles->push_back(*existing_profile);
1058 } 1058 }
1059 1059
1060 // If the new profile was not merged with an existing one, add it to the list. 1060 // If the new profile was not merged with an existing one, add it to the list.
1061 if (!matching_profile_found) 1061 if (!matching_profile_found) {
1062 merged_profiles->push_back(new_profile); 1062 merged_profiles->push_back(new_profile);
1063 1063 AutofillMetrics::LogProfileActionOnFormSubmitted(
1064 AutofillMetrics::LogAutomaticProfileCreation(!matching_profile_found); 1064 AutofillMetrics::NEW_PROFILE_CREATED);
1065 }
1065 1066
1066 return guid; 1067 return guid;
1067 } 1068 }
1068 1069
1069 bool PersonalDataManager::IsCountryOfInterest(const std::string& country_code) 1070 bool PersonalDataManager::IsCountryOfInterest(const std::string& country_code)
1070 const { 1071 const {
1071 DCHECK_EQ(2U, country_code.size()); 1072 DCHECK_EQ(2U, country_code.size());
1072 1073
1073 const std::vector<AutofillProfile*>& profiles = web_profiles(); 1074 const std::vector<AutofillProfile*>& profiles = web_profiles();
1074 std::list<std::string> country_codes; 1075 std::list<std::string> country_codes;
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 web_profiles().end()); 1343 web_profiles().end());
1343 if (IsExperimentalWalletIntegrationEnabled() && 1344 if (IsExperimentalWalletIntegrationEnabled() &&
1344 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { 1345 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) {
1345 profiles_.insert( 1346 profiles_.insert(
1346 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); 1347 profiles_.end(), server_profiles_.begin(), server_profiles_.end());
1347 } 1348 }
1348 return profiles_; 1349 return profiles_;
1349 } 1350 }
1350 1351
1351 } // namespace autofill 1352 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_profile_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698