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 a8361dd678905e958c8e54b576d490f127ecd89e..14011159fabc935369b46d08f333c99bbcc6faca 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
@@ -125,6 +125,7 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl( |
const FormData& form, |
const GURL& source_url, |
const content::SSLStatus& ssl_status, |
+ const AutofillMetrics& metric_logger, |
const base::Callback<void(const FormStructure*)>& callback) |
: profile_(Profile::FromBrowserContext(contents->GetBrowserContext())), |
contents_(contents), |
@@ -138,7 +139,9 @@ 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()), |
+ metric_logger_(metric_logger) { |
// TODO(estade): |this| should observe PersonalDataManager. |
// TODO(estade): remove duplicates from |form|? |
@@ -490,6 +493,9 @@ void AutofillDialogControllerImpl::FocusMoved() { |
} |
void AutofillDialogControllerImpl::ViewClosed(DialogAction action) { |
+ const base::TimeDelta dialog_duration = |
+ base::Time::Now() - dialog_shown_timestamp_; |
Dan Beam
2013/01/31 19:47:16
opt nit: used once, inline, also
DialogDismissa
Ilya Sherman
2013/02/01 09:55:17
Done.
|
+ |
if (action == ACTION_SUBMIT) { |
FillOutputForSection(SECTION_EMAIL); |
FillOutputForSection(SECTION_CC); |
@@ -505,8 +511,12 @@ void AutofillDialogControllerImpl::ViewClosed(DialogAction action) { |
FillOutputForSection(SECTION_SHIPPING); |
} |
callback_.Run(&form_structure_); |
+ metric_logger_.LogRequestAutocompleteUiDuration( |
+ dialog_duration, AutofillMetrics::DIALOG_ACCEPTED); |
Dan Beam
2013/01/31 19:47:16
opt nit:
dismissal_action = AutofillMetrics::DI
Ilya Sherman
2013/02/01 09:55:17
Done.
|
} else { |
callback_.Run(NULL); |
+ metric_logger_.LogRequestAutocompleteUiDuration( |
+ dialog_duration, AutofillMetrics::DIALOG_CANCELED); |
Dan Beam
2013/01/31 19:47:16
opt nit:
dismissal_action = AutofillMetrics::DI
Ilya Sherman
2013/02/01 09:55:17
Done.
|
} |
Dan Beam
2013/01/31 19:47:16
opt nit:
metric_logger_.LogRequestAutocompleteU
Ilya Sherman
2013/02/01 09:55:17
Done.
|
delete this; |