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

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

Issue 2740633002: [Autofill] Add upstreaming UKM (Closed)
Patch Set: Fix for Android and iOS 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.h
diff --git a/components/autofill/core/browser/autofill_metrics.h b/components/autofill/core/browser/autofill_metrics.h
index 4127e9cd09d853a6b87b5e3fe77c4a8fb65c2ca2..63ef69d4e38bb73453a8e2251da7ca3656a9992c 100644
--- a/components/autofill/core/browser/autofill_metrics.h
+++ b/components/autofill/core/browser/autofill_metrics.h
@@ -17,7 +17,17 @@
namespace base {
class TimeDelta;
-}
+} // namespace base
+
+namespace ukm {
+class UkmService;
+} // namespace ukm
+
+namespace internal {
+// Name constants are exposed here so they can be referenced from tests.
+extern const char kUKMCardUploadDecisionEntryName[];
+extern const char kUKMCardUploadDecisionMetricName[];
+} // namespace internal
namespace autofill {
@@ -680,6 +690,20 @@ class AutofillMetrics {
// suggestion to show an explanation of the warning.
static void LogShowedHttpNotSecureExplanation();
+ // Logs the card upload decision ukm based on the specified |url| and
+ // |upload_decision|.
+ static void LogCardUploadDecisionMetricUkm(
+ ukm::UkmService* ukm_service,
+ const GURL& url,
+ AutofillMetrics::CardUploadDecisionMetric upload_decision);
+
+ // Logs the the |ukm| with the specified |url| and the specified |metrics|.
rkaplow 2017/03/10 19:00:27 ukm as as a string isn't super clear. Ukm Entry?
sebsg 2017/03/10 19:25:33 Done.
rkaplow 2017/03/10 20:26:16 please adjust the comment too
sebsg 2017/03/10 20:38:07 Done.
+ // Returns whether the ukm was sucessfully logged.
+ static bool LogUkm(ukm::UkmService* ukm_service,
+ const GURL& url,
+ const std::string& ukm,
+ const std::map<std::string, int>& metrics);
+
// Utility to autofill form events in the relevant histograms depending on
// the presence of server and/or local data.
class FormEventLogger {

Powered by Google App Engine
This is Rietveld 408576698