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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 12588002: [Autofill] Add user type metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment cleanup Created 7 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 | « chrome/browser/autofill/autofill_metrics.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index bec0a50f1396697ea4fcfd8958b636709e4bc2f8..de831b54ffd9d2737be28455165c51cf857120a6 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -1030,6 +1030,31 @@ void AutofillDialogControllerImpl::OnDidGetFullWallet(
void AutofillDialogControllerImpl::OnDidGetWalletItems(
scoped_ptr<wallet::WalletItems> wallet_items) {
+ if (!wallet_items_ && wallet_items) {
Dan Beam 2013/03/12 02:06:01 wallet_items will always be non-NULL here
+ // On the first successful response, log any relevant user type metrics.
+ // Consider a user to be an Autofill user if the user has any credit cards
+ // or addresses saved. Check that the item count is greater than 1 because
+ // an "empty" menu still has the "add new" menu item.
+ bool has_autofill_profiles =
+ suggested_cc_.GetItemCount() > 1 ||
+ suggested_billing_.GetItemCount() > 1;
+ AutofillMetrics::DialogUserTypeMetric user_type;
+ if (SignedInState() == SIGNED_IN) {
+ if (!wallet_items->instruments().empty())
+ user_type = AutofillMetrics::DIALOG_WALLET_USER_SIGNED_IN;
Dan Beam 2013/03/12 02:06:01 why are we not logging whether a user has both aut
+ else if (has_autofill_profiles)
+ user_type = AutofillMetrics::DIALOG_AUTOFILL_USER_SIGNED_IN;
+ else
+ user_type = AutofillMetrics::DIALOG_NEW_USER_SIGNED_IN;
Dan Beam 2013/03/12 02:06:01 I think this is a little strange to assume a user
+ } else {
+ if (has_autofill_profiles)
+ user_type = AutofillMetrics::DIALOG_AUTOFILL_USER_NOT_SIGNED_IN;
+ else
+ user_type = AutofillMetrics::DIALOG_NEW_USER_NOT_SIGNED_IN;
+ }
+ metric_logger_.LogDialogUserType(dialog_type_, user_type);
Dan Beam 2013/03/12 02:06:01 if I were writing this it'd go something like:
+ }
+
bool items_changed = !wallet_items_ || *wallet_items != *wallet_items_;
wallet_items_ = wallet_items.Pass();
WalletRequestCompleted(true);
« no previous file with comments | « chrome/browser/autofill/autofill_metrics.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698