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

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: Rebase harder 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 83b4094c4f15b266f25b9ed15e484b5eef5aac8b..b7bee418dd667898aec7416e064ca8cb76ffeaca 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -128,6 +128,8 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl(
const FormData& form,
const GURL& source_url,
const content::SSLStatus& ssl_status,
+ const AutofillMetrics& metric_logger,
+ DialogType dialog_type,
const base::Callback<void(const FormStructure*)>& callback)
: profile_(Profile::FromBrowserContext(contents->GetBrowserContext())),
contents_(contents),
@@ -142,7 +144,9 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl(
ALLOW_THIS_IN_INITIALIZER_LIST(suggested_cc_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(suggested_billing_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(suggested_shipping_(this)),
- section_showing_popup_(SECTION_BILLING) {
+ section_showing_popup_(SECTION_BILLING),
+ metric_logger_(metric_logger),
+ dialog_type_(dialog_type) {
// TODO(estade): |this| should observe PersonalDataManager.
// TODO(estade): remove duplicates from |form|?
@@ -157,6 +161,8 @@ AutofillDialogControllerImpl::~AutofillDialogControllerImpl() {
}
void AutofillDialogControllerImpl::Show() {
+ dialog_shown_timestamp_ = base::Time::Now();
+
bool has_types = false;
bool has_sections = false;
form_structure_.ParseFieldTypesFromAutocompleteAttributes(&has_types,
@@ -597,6 +603,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_, dialog_type_, metric);
+
delete this;
}
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_impl.h ('k') | chrome/browser/ui/autofill/autofill_dialog_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698