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

Unified Diff: components/autofill/core/browser/autofill_metrics.cc

Issue 2711543002: Experiment to add bank name in autofill ui. (Closed)
Patch Set: Address comments Created 3 years, 6 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: components/autofill/core/browser/autofill_metrics.cc
diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc
index 3039a0832fdb29cbf73dfe903858cfbc06a913ba..f011954055fc9ae2cc638c78f279e6a65257e331 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -985,6 +985,7 @@ AutofillMetrics::FormEventLogger::FormEventLogger(
has_logged_suggestion_filled_(false),
has_logged_will_submit_(false),
has_logged_submitted_(false),
+ has_logged_bank_name_available_(false),
logged_suggestion_filled_was_server_data_(false),
logged_suggestion_filled_was_masked_server_card_(false),
form_interactions_ukm_logger_(form_interactions_ukm_logger) {}
@@ -1026,6 +1027,10 @@ void AutofillMetrics::FormEventLogger::OnDidShowSuggestions(
if (!has_logged_suggestions_shown_) {
has_logged_suggestions_shown_ = true;
Log(AutofillMetrics::FORM_EVENT_SUGGESTIONS_SHOWN_ONCE);
+ if (has_logged_bank_name_available_) {
+ Log(AutofillMetrics::
+ FORM_EVENT_SUGGESTIONS_SHOWN_WITH_BANK_NAME_AVAILABLE_ONCE);
Jared Saul 2017/06/14 16:49:15 indent -4
Shanfeng 2017/06/14 17:48:25 All other places have this indent. The indent belo
Jared Saul 2017/06/14 17:54:10 Ah, weird, ok.
+ }
}
if (is_for_credit_card_) {
@@ -1074,6 +1079,10 @@ void AutofillMetrics::FormEventLogger::OnDidFillSuggestion(
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED_ONCE);
} else if (credit_card.record_type() == CreditCard::FULL_SERVER_CARD) {
Log(AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_FILLED_ONCE);
+ if (has_logged_bank_name_available_) {
+ Log(AutofillMetrics::
+ FORM_EVENT_SERVER_SUGGESTION_FILLED_WITH_BANK_NAME_AVAILABLE_ONCE);
+ }
} else {
Log(AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_FILLED_ONCE);
}
@@ -1161,6 +1170,10 @@ void AutofillMetrics::FormEventLogger::OnFormSubmitted() {
}
}
+void AutofillMetrics::FormEventLogger::SetBankNameAvailable() {
+ has_logged_bank_name_available_ = true;
+}
+
void AutofillMetrics::FormEventLogger::Log(FormEvent event) const {
DCHECK_LT(event, NUM_FORM_EVENTS);
std::string name("Autofill.FormEvents.");
@@ -1192,6 +1205,13 @@ void AutofillMetrics::FormEventLogger::Log(FormEvent event) const {
LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS);
}
+void AutofillMetrics::FormEventLogger::Log(
+ BankNameExperimentFormEvent event) const {
+ DCHECK_LT(event, BANK_NAME_NUM_FORM_EVENTS);
+ std::string name("Autofill.FormEvents.CreditCard.BankNameExperiment");
+ LogUMAHistogramEnumeration(name, event, BANK_NAME_NUM_FORM_EVENTS);
+}
+
AutofillMetrics::FormInteractionsUkmLogger::FormInteractionsUkmLogger(
ukm::UkmRecorder* ukm_recorder)
: ukm_recorder_(ukm_recorder) {}

Powered by Google App Engine
This is Rietveld 408576698