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

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: 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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 // whereas verified profiles should only ever be overwritten by verified 1052 // whereas verified profiles should only ever be overwritten by verified
1053 // data. If an automatically aggregated profile would overwrite a 1053 // data. If an automatically aggregated profile would overwrite a
1054 // verified profile, just drop it. 1054 // verified profile, just drop it.
1055 matching_profile_found = true; 1055 matching_profile_found = true;
1056 guid = existing_profile->guid(); 1056 guid = existing_profile->guid();
1057 } 1057 }
1058 merged_profiles->push_back(*existing_profile); 1058 merged_profiles->push_back(*existing_profile);
1059 } 1059 }
1060 1060
1061 // If the new profile was not merged with an existing one, add it to the list. 1061 // If the new profile was not merged with an existing one, add it to the list.
1062 if (!matching_profile_found) 1062 if (!matching_profile_found) {
1063 merged_profiles->push_back(new_profile); 1063 merged_profiles->push_back(new_profile);
1064 1064 AutofillMetrics::LogProfileActionOnFormSubmitted(
1065 AutofillMetrics::LogAutomaticProfileCreation(!matching_profile_found); 1065 AutofillMetrics::NEW_PROFILE_CREATED);
1066 }
1066 1067
1067 return guid; 1068 return guid;
1068 } 1069 }
1069 1070
1070 bool PersonalDataManager::IsCountryOfInterest(const std::string& country_code) 1071 bool PersonalDataManager::IsCountryOfInterest(const std::string& country_code)
1071 const { 1072 const {
1072 DCHECK_EQ(2U, country_code.size()); 1073 DCHECK_EQ(2U, country_code.size());
1073 1074
1074 const std::vector<AutofillProfile*>& profiles = web_profiles(); 1075 const std::vector<AutofillProfile*>& profiles = web_profiles();
1075 std::list<std::string> country_codes; 1076 std::list<std::string> country_codes;
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 web_profiles().end()); 1349 web_profiles().end());
1349 if (IsExperimentalWalletIntegrationEnabled() && 1350 if (IsExperimentalWalletIntegrationEnabled() &&
1350 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { 1351 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) {
1351 profiles_.insert( 1352 profiles_.insert(
1352 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); 1353 profiles_.end(), server_profiles_.begin(), server_profiles_.end());
1353 } 1354 }
1354 return profiles_; 1355 return profiles_;
1355 } 1356 }
1356 1357
1357 } // namespace autofill 1358 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698