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

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

Issue 2776223002: Adds UKM for autofill attributes in form_structure. (Closed)
Patch Set: Adds UKM for autofill attributes in form_structure. Created 3 years, 9 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 239334c5e660612da4f9da3d85384c3f663ff38e..bc30e682ee8c006aaa8784e9cf74cd7b09548859 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -20,6 +20,8 @@
namespace internal {
const char kUKMCardUploadDecisionEntryName[] = "Autofill.CardUploadDecision";
const char kUKMCardUploadDecisionMetricName[] = "UploadDecision";
+const char kUKMDeveloperEngagementEntryName[] = "Autofill.DeveloperEngagement";
+const char kUKMDeveloperEngagementMetricName[] = "DeveloperEngagement";
} // namespace internal
namespace autofill {
@@ -712,6 +714,21 @@ void AutofillMetrics::LogCardUploadDecisionUkm(
}
// static
+void AutofillMetrics::LogDeveloperEngagementUkm(
+ ukm::UkmService* ukm_service,
+ const GURL& url,
+ AutofillMetrics::DeveloperEngagementMetric form_structure_metric) {
+ if (form_structure_metric >=
+ AutofillMetrics::NUM_DEVELOPER_ENGAGEMENT_METRICS)
+ return;
+
+ std::map<std::string, int> metrics = {
+ {internal::kUKMDeveloperEngagementMetricName,
+ static_cast<int>(form_structure_metric)}};
+ LogUkm(ukm_service, url, internal::kUKMDeveloperEngagementEntryName, metrics);
+}
+
+// static
bool AutofillMetrics::LogUkm(ukm::UkmService* ukm_service,
const GURL& url,
const std::string& ukm_entry_name,

Powered by Google App Engine
This is Rietveld 408576698