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

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

Issue 2849753002: Logs all reasons card upload was not offered in UKM and UMA. (Closed)
Patch Set: Created 3 years, 8 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 77442395f201073a68feac7dc21890f545343393..20604947bb9ebcb8228e2d413c1ed70ee08a63e9 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -726,16 +726,18 @@ void AutofillMetrics::LogShowedHttpNotSecureExplanation() {
}
// static
-void AutofillMetrics::LogCardUploadDecisionUkm(
+void AutofillMetrics::LogCardUploadDecisionsUkm(
ukm::UkmService* ukm_service,
const GURL& url,
- AutofillMetrics::CardUploadDecisionMetric upload_decision) {
- if (upload_decision >= AutofillMetrics::NUM_CARD_UPLOAD_DECISION_METRICS)
- return;
-
- const std::vector<std::pair<const char*, int>> metrics = {
- {internal::kUKMCardUploadDecisionMetricName,
- static_cast<int>(upload_decision)}};
+ const std::vector<AutofillMetrics::CardUploadDecisionMetric>&
+ upload_decisions) {
+ std::vector<std::pair<const char*, int>> metrics;
+
+ for (const auto it : upload_decisions) {
+ DCHECK_LT(it, AutofillMetrics::NUM_CARD_UPLOAD_DECISION_METRICS);
+ metrics.push_back(
+ {internal::kUKMCardUploadDecisionMetricName, static_cast<int>(it)});
sebsg 2017/04/28 15:26:24 This works, but what do you think about a bitfield
csashi 2017/04/28 23:47:45 Done.
+ }
LogUkm(ukm_service, url, internal::kUKMCardUploadDecisionEntryName, metrics);
}

Powered by Google App Engine
This is Rietveld 408576698