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

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

Issue 880353002: [Autofill] Log the number of autofill profiles available at form submission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleaned up 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/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 0d0ac3903336366acecc5b2b2752fe3c108ee057..3dea42ee3356957992dd16782ce6ac960f1b0695 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -339,15 +339,20 @@ bool AutofillManager::OnFormSubmitted(const FormData& form,
if (!FindCachedForm(form, &cached_submitted_form))
return false;
+ const std::vector<AutofillProfile*>& profiles = personal_data_->GetProfiles();
+ const std::vector<CreditCard*>& credit_cards =
+ personal_data_->GetCreditCards();
+
submitted_form->UpdateFromCache(*cached_submitted_form);
- if (submitted_form->IsAutofillable())
+ if (submitted_form->IsAutofillable()) {
ImportFormData(*submitted_form);
+ AutofillMetrics::LogNumberOfProfilesAtAutofillableFormSubmission(
+ profiles.size());
+ }
+
// Only upload server statistics and UMA metrics if at least some local data
// is available to use as a baseline.
- const std::vector<AutofillProfile*>& profiles = personal_data_->GetProfiles();
- const std::vector<CreditCard*>& credit_cards =
- personal_data_->GetCreditCards();
if (!profiles.empty() || !credit_cards.empty()) {
// Copy the profile and credit card data, so that it can be accessed on a
// separate thread.
@@ -507,7 +512,9 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
RemoveDuplicateSuggestions(&suggestions);
// The first time we show suggestions on this page, log the number of
- // suggestions shown.
+ // suggestions available.
+ // TODO(mathp): Differentiate between number of suggestions available
+ // (current metric) and number shown to the user.
if (!has_logged_address_suggestions_count_ && !section_is_autofilled) {
AutofillMetrics::LogAddressSuggestionsCount(suggestions.size());
has_logged_address_suggestions_count_ = true;

Powered by Google App Engine
This is Rietveld 408576698