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

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

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: addressing isherman comments 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.h
diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h
index ec9286c4ac8296614ee7a6c364fc60614cee0747..b277926d4ac5509e4069c8c67f4841fcb8762ccd 100644
--- a/components/autofill/core/browser/autofill_manager.h
+++ b/components/autofill/core/browser/autofill_manager.h
@@ -23,6 +23,7 @@
#include "components/autofill/core/browser/autofill_client.h"
#include "components/autofill/core/browser/autofill_download_manager.h"
#include "components/autofill/core/browser/autofill_driver.h"
+#include "components/autofill/core/browser/autofill_metrics.h"
#include "components/autofill/core/browser/card_unmask_delegate.h"
#include "components/autofill/core/browser/form_structure.h"
#include "components/autofill/core/browser/personal_data_manager.h"
@@ -231,7 +232,7 @@ class AutofillManager : public AutofillDownloadManager::Observer,
void OnUnmaskVerificationResult(bool success);
// Returns false if Autofill is disabled or if no Autofill data is available.
- bool RefreshDataModels() const;
+ bool RefreshDataModels();
// Unpacks |unique_id| and fills |form_group| and |variant| with the
// appropriate data source and variant index. Sets |is_credit_card| to true
@@ -309,6 +310,10 @@ class AutofillManager : public AutofillDownloadManager::Observer,
// Shared code to determine if |form| should be uploaded.
bool ShouldUploadForm(const FormStructure& form);
+ // Utility to log the form event.
+ void LogFormEvent(AutofillMetrics::AutofillFormEvent event,
+ bool is_credit_card);
+
// Provides driver-level context to the shared code of the component. Must
// outlive this object.
AutofillDriver* driver_;
@@ -332,10 +337,19 @@ class AutofillManager : public AutofillDownloadManager::Observer,
// Handles single-field autocomplete form data.
scoped_ptr<AutocompleteHistoryManager> autocomplete_history_manager_;
+ // Utilities for logging form events.
+ scoped_ptr<AutofillMetrics::FormEventLogger> address_form_event_logger_;
+ scoped_ptr<AutofillMetrics::FormEventLogger> credit_card_form_event_logger_;
+
// Have we logged whether Autofill is enabled for this page load?
bool has_logged_autofill_enabled_;
// Have we logged an address suggestions count metric for this page?
bool has_logged_address_suggestions_count_;
+ // Have we logged that the user interacted with a credit card form in
+ // this page?
+ bool has_logged_interacted_with_credit_card_form_;
+ // Have we logged that the user interacted with an address form in this page?
+ bool has_logged_interacted_with_address_form_;
// Have we shown Autofill suggestions at least once?
bool did_show_suggestions_;
// Has the user manually edited at least one form field among the autofillable

Powered by Google App Engine
This is Rietveld 408576698