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

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

Issue 1839583003: [Autofill] Log the number of stored local credit cards (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 9 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 | « components/autofill/core/browser/personal_data_manager.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3ef8d1d04b8ed0a411362676001f72a0d629f319..841f45469f7588627bc57a90aaf8b5ec42282aaa 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -212,7 +212,8 @@ PersonalDataManager::PersonalDataManager(const std::string& app_locale)
pref_service_(NULL),
account_tracker_(NULL),
is_off_the_record_(false),
- has_logged_profile_count_(false) {}
+ has_logged_profile_count_(false),
+ has_logged_credit_card_count_(false) {}
void PersonalDataManager::Init(scoped_refptr<AutofillWebDataService> database,
PrefService* pref_service,
@@ -296,6 +297,7 @@ void PersonalDataManager::OnWebDataServiceRequestDone(
if (h == pending_creditcards_query_) {
ReceiveLoadedDbValues(h, result, &pending_creditcards_query_,
&local_credit_cards_);
+ LogLocalCreditCardCount();
} else {
ReceiveLoadedDbValues(h, result, &pending_server_creditcards_query_,
&server_credit_cards_);
@@ -1191,6 +1193,13 @@ void PersonalDataManager::LogProfileCount() const {
}
}
+void PersonalDataManager::LogLocalCreditCardCount() const {
+ if (!has_logged_credit_card_count_) {
+ AutofillMetrics::LogStoredLocalCreditCardCount(local_credit_cards_.size());
+ has_logged_credit_card_count_ = true;
+ }
+}
+
std::string PersonalDataManager::MostCommonCountryCodeFromProfiles() const {
if (!IsAutofillEnabled())
return std::string();
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698