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

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

Issue 2776223002: Adds UKM for autofill attributes in form_structure. (Closed)
Patch Set: Resolves merge conflicts with FORM_CONTAINS_UPI_VPA_HINT. 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..e813b1836f15f987cf2b02cadc879399f5e49b74 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 {
@@ -704,14 +706,24 @@ void AutofillMetrics::LogCardUploadDecisionUkm(
if (upload_decision >= AutofillMetrics::NUM_CARD_UPLOAD_DECISION_METRICS)
return;
- // Set up as a map because the follow-up CL will add more metrics.
- std::map<std::string, int> metrics = {
+ const std::map<std::string, int> metrics = {
{internal::kUKMCardUploadDecisionMetricName,
static_cast<int>(upload_decision)}};
LogUkm(ukm_service, url, internal::kUKMCardUploadDecisionEntryName, metrics);
}
// static
+void AutofillMetrics::LogDeveloperEngagementUkm(
+ ukm::UkmService* ukm_service,
+ const GURL& url,
+ AutofillMetrics::DeveloperEngagementMetric metric) {
+ const std::map<std::string, int> form_structure_metrics = {
+ {internal::kUKMDeveloperEngagementMetricName, static_cast<int>(metric)}};
+ LogUkm(ukm_service, url, internal::kUKMDeveloperEngagementEntryName,
+ form_structure_metrics);
+}
+
+// static
bool AutofillMetrics::LogUkm(ukm::UkmService* ukm_service,
const GURL& url,
const std::string& ukm_entry_name,
« no previous file with comments | « components/autofill/core/browser/autofill_metrics.h ('k') | components/autofill/core/browser/autofill_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698