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

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

Issue 12091086: [Autofill] Add UMA timing metrics for requestAutocomplete dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the test. Created 7 years, 10 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
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;
}

Powered by Google App Engine
This is Rietveld 408576698