summaryrefslogtreecommitdiffstats
path: root/components/autofill
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-13 05:06:47 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-13 05:06:47 +0000
commit3c33b226aca0de240147a1b95e300d312369b730 (patch)
tree715c5d1e3038e1cb2917c20d7b88ec2176634735 /components/autofill
parent9decd75f992e532b8bb5bc205d58dddab739277b (diff)
downloadchromium_src-3c33b226aca0de240147a1b95e300d312369b730.zip
chromium_src-3c33b226aca0de240147a1b95e300d312369b730.tar.gz
chromium_src-3c33b226aca0de240147a1b95e300d312369b730.tar.bz2
[Autofill] Metrics for dialog UI user interactions.
BUG=165570 Review URL: https://chromiumcodereview.appspot.com/12413007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194087 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/autofill')
-rw-r--r--components/autofill/browser/autofill_metrics.cc13
-rw-r--r--components/autofill/browser/autofill_metrics.h87
2 files changed, 92 insertions, 8 deletions
diff --git a/components/autofill/browser/autofill_metrics.cc b/components/autofill/browser/autofill_metrics.cc
index e83ae02..f36d3b1 100644
--- a/components/autofill/browser/autofill_metrics.cc
+++ b/components/autofill/browser/autofill_metrics.cc
@@ -353,6 +353,13 @@ void AutofillMetrics::LogCreditCardInfoBarMetric(InfoBarMetric metric) const {
NUM_INFO_BAR_METRICS);
}
+void AutofillMetrics::LogDialogDismissalState(
+ autofill::DialogType dialog_type,
+ DialogDismissalState state) const {
+ std::string name = GetPrefixForDialogType(dialog_type) + ".DismissalState";
+ LogUMAHistogramEnumeration(name, state, NUM_DIALOG_DISMISSAL_STATES);
+}
+
void AutofillMetrics::LogDialogInitialUserState(
autofill::DialogType dialog_type,
DialogInitialUserStateMetric user_type) const {
@@ -395,6 +402,12 @@ void AutofillMetrics::LogDialogUiDuration(
LogUMAHistogramLongTimes(prefix + ".UiDuration." + suffix, duration);
}
+void AutofillMetrics::LogDialogUiEvent(autofill::DialogType dialog_type,
+ DialogUiEvent event) const {
+ std::string name = GetPrefixForDialogType(dialog_type) + ".UiEvents";
+ LogUMAHistogramEnumeration(name, event, NUM_DIALOG_UI_EVENTS);
+}
+
void AutofillMetrics::LogWalletErrorMetric(autofill::DialogType dialog_type,
WalletErrorMetric metric) const {
std::string name = GetPrefixForDialogType(dialog_type) + ".WalletErrors";
diff --git a/components/autofill/browser/autofill_metrics.h b/components/autofill/browser/autofill_metrics.h
index ddd16b9..2f9abd0 100644
--- a/components/autofill/browser/autofill_metrics.h
+++ b/components/autofill/browser/autofill_metrics.h
@@ -67,12 +67,31 @@ class AutofillMetrics {
// The action the user took to dismiss a dialog.
enum DialogDismissalAction {
- DIALOG_ACCEPTED = 0, // The user accepted, i.e. confirmed, the dialog.
+ DIALOG_ACCEPTED = 0, // The user accepted, i.e. submitted, the dialog.
DIALOG_CANCELED, // The user canceled out of the dialog.
};
- // The initial state of user that's interacting with a freshly shown
- // requestAutocomplete or Autocheckout dialog.
+ // The state of the Autofill dialog when it was dismissed.
+ enum DialogDismissalState {
+ // The user submitted with no data available to save.
+ DIALOG_ACCEPTED_EXISTING_DATA,
+ // The saved details to Online Wallet on submit.
+ DIALOG_ACCEPTED_SAVE_TO_WALLET,
+ // The saved details to the local Autofill database on submit.
+ DIALOG_ACCEPTED_SAVE_TO_AUTOFILL,
+ // The user submitted without saving any edited sections.
+ DIALOG_ACCEPTED_NO_SAVE,
+ // The user canceled with no edit UI showing.
+ DIALOG_CANCELED_NO_EDITS,
+ // The user canceled with edit UI showing, but no invalid fields.
+ DIALOG_CANCELED_NO_INVALID_FIELDS,
+ // The user canceled with at least one invalid field.
+ DIALOG_CANCELED_WITH_INVALID_FIELDS,
+ NUM_DIALOG_DISMISSAL_STATES
+ };
+
+ // The initial state of user that's interacting with a freshly shown Autofill
+ // dialog.
enum DialogInitialUserStateMetric {
// Could not determine the user's state due to failure to communicate with
// the Wallet server.
@@ -115,6 +134,50 @@ class AutofillMetrics {
NUM_DIALOG_SECURITY_METRICS
};
+ // For measuring how users are interacting with the Autofill dialog UI.
+ enum DialogUiEvent {
+ // Baseline metric: The dialog was shown.
+ DIALOG_UI_SHOWN = 0,
+
+ // Dialog dismissal actions:
+ DIALOG_UI_ACCEPTED,
+ DIALOG_UI_CANCELED,
+
+ // Selections within the account switcher:
+ // Switched from a Wallet account to local Autofill data.
+ DIALOG_UI_ACCOUNT_CHOOSER_SWITCHED_TO_AUTOFILL,
+ // Switched from local Autofill data to a Wallet account.
+ DIALOG_UI_ACCOUNT_CHOOSER_SWITCHED_TO_WALLET,
+ // Switched from one Wallet account to another one.
+ DIALOG_UI_ACCOUNT_CHOOSER_SWITCHED_WALLET_ACCOUNT,
+
+ // The sign-in UI was shown.
+ DIALOG_UI_SIGNIN_SHOWN,
+
+ // Selecting a different item from a suggestion menu dropdown:
+ DIALOG_UI_EMAIL_SELECTED_SUGGESTION_CHANGED,
+ DIALOG_UI_BILLING_SELECTED_SUGGESTION_CHANGED,
+ DIALOG_UI_CC_BILLING_SELECTED_SUGGESTION_CHANGED,
+ DIALOG_UI_SHIPPING_SELECTED_SUGGESTION_CHANGED,
+ DIALOG_UI_CC_SELECTED_SUGGESTION_CHANGED,
+
+ // Showing the editing UI for a section of the dialog:
+ DIALOG_UI_EMAIL_EDIT_UI_SHOWN,
+ DIALOG_UI_BILLING_EDIT_UI_SHOWN,
+ DIALOG_UI_CC_BILLING_EDIT_UI_SHOWN,
+ DIALOG_UI_SHIPPING_EDIT_UI_SHOWN,
+ DIALOG_UI_CC_EDIT_UI_SHOWN,
+
+ // Adding a new item in a section of the dialog:
+ DIALOG_UI_EMAIL_ITEM_ADDED,
+ DIALOG_UI_BILLING_ITEM_ADDED,
+ DIALOG_UI_CC_BILLING_ITEM_ADDED,
+ DIALOG_UI_SHIPPING_ITEM_ADDED,
+ DIALOG_UI_CC_ITEM_ADDED,
+
+ NUM_DIALOG_UI_EVENTS
+ };
+
enum InfoBarMetric {
INFOBAR_SHOWN = 0, // We showed an infobar, e.g. prompting to save credit
// card info.
@@ -321,6 +384,10 @@ class AutofillMetrics {
virtual void LogUserHappinessMetric(UserHappinessMetric metric) const;
+ // Logs |state| to the dismissal states histogram for |dialog_type|.
+ virtual void LogDialogDismissalState(autofill::DialogType dialog_type,
+ DialogDismissalState state) const;
+
// This should be called as soon as the user's signed-in status and Wallet
// item count is known. Records that a user starting out in |user_state| is
// interacting with a dialog of |dialog_type|.
@@ -336,16 +403,20 @@ class AutofillMetrics {
virtual void LogDialogSecurityMetric(autofill::DialogType dialog_type,
DialogSecurityMetric metric) const;
- // This should be called when the requestAutocomplete dialog, invoked by a
- // dialog of type |dialog_type|, is closed. |duration| should be the time
- // elapsed between the dialog being shown and it being closed.
- // |dismissal_action| should indicate whether the user dismissed the dialog by
- // submitting the form data or by canceling.
+ // This should be called when the Autofill dialog, invoked by a dialog of type
+ // |dialog_type|, is closed. |duration| should be the time elapsed between
+ // the dialog being shown and it being closed. |dismissal_action| should
+ // indicate whether the user dismissed the dialog by submitting the form data
+ // or by canceling.
virtual void LogDialogUiDuration(
const base::TimeDelta& duration,
autofill::DialogType dialog_type,
DialogDismissalAction dismissal_action) const;
+ // Logs |event| to the UI events histogram for |dialog_type|.
+ virtual void LogDialogUiEvent(autofill::DialogType dialog_type,
+ DialogUiEvent event) const;
+
// Logs |metric| to the Wallet errors histogram for |dialog_type|.
virtual void LogWalletErrorMetric(autofill::DialogType dialog_type,
WalletErrorMetric metric) const;