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 123704ec7aba365ae787d035aad3804121a4b06e..0f2253288f21ee0054626efae8b9ff071dcc2ab8 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| @@ -125,6 +125,8 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl( |
| const FormData& form, |
| const GURL& source_url, |
| const content::SSLStatus& ssl_status, |
| + const AutofillMetrics& metric_logger, |
| + DialogRequester requester, |
| const base::Callback<void(const FormStructure*)>& callback) |
| : profile_(Profile::FromBrowserContext(contents->GetBrowserContext())), |
| contents_(contents), |
| @@ -138,7 +140,10 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl( |
| ALLOW_THIS_IN_INITIALIZER_LIST(suggested_billing_(this)), |
| ALLOW_THIS_IN_INITIALIZER_LIST(suggested_shipping_(this)), |
| popup_controller_(NULL), |
| - section_showing_popup_(SECTION_BILLING) { |
| + section_showing_popup_(SECTION_BILLING), |
| + dialog_shown_timestamp_(base::Time::Now()), |
|
Evan Stade
2013/02/05 20:06:41
why here and not in Show()?
Ilya Sherman
2013/02/06 00:02:25
Done.
|
| + metric_logger_(metric_logger), |
| + requester_(requester) { |
| // TODO(estade): |this| should observe PersonalDataManager. |
| // TODO(estade): remove duplicates from |form|? |
| @@ -527,6 +532,13 @@ void AutofillDialogControllerImpl::ViewClosed(DialogAction action) { |
| callback_.Run(NULL); |
| } |
| + AutofillMetrics::DialogDismissalAction metric = |
| + action == ACTION_SUBMIT ? |
| + AutofillMetrics::DIALOG_ACCEPTED : |
| + AutofillMetrics::DIALOG_CANCELED; |
| + metric_logger_.LogRequestAutocompleteUiDuration( |
| + base::Time::Now() - dialog_shown_timestamp_, requester_, metric); |
| + |
| delete this; |
| } |