Chromium Code Reviews| 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 929a9035f20c2d67ff7946160b9062b53d501c27..c357b96c827ab8ab39595a6fc9f72294ecb742ee 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| @@ -1027,6 +1027,31 @@ void AutofillDialogControllerImpl::OnDidGetFullWallet( |
| void AutofillDialogControllerImpl::OnDidGetWalletItems( |
| scoped_ptr<wallet::WalletItems> wallet_items) { |
| + if (!wallet_items_ && wallet_items) { |
|
Dan Beam
2013/03/07 17:16:50
I don't really know how you'd make this harder to
Dan Beam
2013/03/07 17:16:50
this currently assumes we don't re-request wallet
Ilya Sherman
2013/03/09 01:58:57
Do you have a suggestion on how to better hook thi
Dan Beam
2013/03/09 02:02:31
^ yes, something along these lines, or figure out
|
| + // 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; |
|
Dan Beam
2013/03/07 17:16:50
what if there's a network error/wallet error/malfo
Ilya Sherman
2013/03/09 01:58:57
Then we won't get a stat for that user. Since thi
Dan Beam
2013/03/09 02:02:31
how do you know this will affect users equally? ca
|
| + AutofillMetrics::DialogUserTypeMetric user_type; |
| + if (SignedInState() == SIGNED_IN) { |
| + if (!wallet_items->instruments().empty()) |
| + user_type = AutofillMetrics::DIALOG_WALLET_USER_SIGNED_IN; |
| + else if (has_autofill_profiles) |
| + user_type = AutofillMetrics::DIALOG_AUTOFILL_USER_SIGNED_IN; |
| + else |
| + user_type = AutofillMetrics::DIALOG_NEW_USER_SIGNED_IN; |
| + } 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); |
| + } |
| + |
| bool items_changed = !wallet_items_ || *wallet_items != *wallet_items_; |
| wallet_items_ = wallet_items.Pass(); |
| WalletRequestCompleted(true); |