Index: components/autofill/core/browser/autofill_metrics.h |
diff --git a/components/autofill/core/browser/autofill_metrics.h b/components/autofill/core/browser/autofill_metrics.h |
index 92539ba77a68ecf710118bcbc385cd717ee9711c..f909bd1a7444602377626cb3573ea02a61b9f5ba 100644 |
--- a/components/autofill/core/browser/autofill_metrics.h |
+++ b/components/autofill/core/browser/autofill_metrics.h |
@@ -243,6 +243,18 @@ class AutofillMetrics { |
NUM_USER_HAPPINESS_METRICS, |
}; |
+ // Form Events for autofill. |
+ // These events are triggered separetly for address and credit card forms. |
+ enum AutofillFormEvent { |
Ilya Sherman
2015/02/02 22:32:16
Since this enum is already in a class that has "Au
Walter Cacau
2015/02/03 00:47:40
Done.
|
+ // User interacted with a field of this kind of form. Logged only once per |
+ // page load. |
+ INTERACTED_ONCE_FORM_EVENT = 0, |
Ilya Sherman
2015/02/02 22:32:16
nit: By convention, FORM_EVENT should be the prefi
Walter Cacau
2015/02/03 00:47:40
Done.
|
+ // TODO(waltercacau): Remove the 2 here once we add more events. |
+ // This circunvents an assertion that gets triggered when you have |
Ilya Sherman
2015/02/02 22:32:16
nit: "circunvents" -> "circumvents"
Walter Cacau
2015/02/03 00:47:40
Done.
|
+ // only one bucket. |
+ NUM_AUTOFILL_FORM_EVENTS = 2, |
+ }; |
+ |
// For measuring the network request time of various Wallet API calls. See |
// WalletClient::RequestType. |
enum WalletApiCallMetric { |
@@ -415,6 +427,31 @@ class AutofillMetrics { |
// form. |
static void LogAddressSuggestionsCount(size_t num_suggestions); |
+ // Utility to autofill form events in the relevant histograms depending on |
+ // the presence of server and/or local data. |
+ class FormEventLogger { |
+ public: |
+ FormEventLogger(bool is_credit_card); |
+ |
+ // Sets if server data is available or not. If not called assumed false. |
+ void set_is_server_data_available(bool is_server_data_available); |
Evan Stade
2015/02/02 23:13:12
inline this function
Walter Cacau
2015/02/03 00:47:40
Done.
|
+ |
+ // Sets if server data is available or not. If not called assumed false. |
+ void set_is_local_data_available(bool is_local_data_available); |
Evan Stade
2015/02/02 23:13:12
inline this function
Walter Cacau
2015/02/03 00:47:40
Done.
|
+ |
+ // Should be called when the user interacted with an autofillable form. |
+ void OnDidInteractWithAutofillableForm(); |
Evan Stade
2015/02/02 23:13:12
move above the setters
Walter Cacau
2015/02/03 00:47:40
Done.
|
+ |
+ private: |
+ // Logs a form event. |
+ void Log(AutofillFormEvent event) const; |
+ |
+ bool is_credit_card_; |
Evan Stade
2015/02/02 23:13:12
nit: variable name doesn't sound quite right. It's
Walter Cacau
2015/02/03 00:47:40
You are right. Doing is_for_credit_card_ just beca
|
+ bool is_server_data_available_; |
+ bool is_local_data_available_; |
+ bool has_logged_interacted_; |
+ }; |
+ |
private: |
DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
}; |