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

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

Issue 2776223002: Adds UKM for autofill attributes in form_structure. (Closed)
Patch Set: Updates tests to account for multiple metrics for same source_url(). 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/form_structure.cc
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc
index 02e861fe9c2a9a7076100f8dc5cd20968a3c1d6b..00b651082f6985721a2a2d2b5b6f2c2595bc6cc6 100644
--- a/components/autofill/core/browser/form_structure.cc
+++ b/components/autofill/core/browser/form_structure.cc
@@ -36,6 +36,7 @@
#include "components/autofill/core/common/signatures_util.h"
#include "components/rappor/public/rappor_utils.h"
#include "components/rappor/rappor_service_impl.h"
+#include "components/ukm/ukm_service.h"
namespace autofill {
namespace {
@@ -332,7 +333,7 @@ FormStructure::FormStructure(const FormData& form)
FormStructure::~FormStructure() {}
-void FormStructure::DetermineHeuristicTypes() {
+void FormStructure::DetermineHeuristicTypes(ukm::UkmService* ukm_service) {
const auto determine_heuristic_types_start_time = base::TimeTicks::Now();
// First, try to detect field types based on each field's |autocomplete|
@@ -363,6 +364,13 @@ void FormStructure::DetermineHeuristicTypes() {
if (has_author_specified_types_) {
AutofillMetrics::LogDeveloperEngagementMetric(
AutofillMetrics::FILLABLE_FORM_CONTAINS_TYPE_HINTS);
+ AutofillMetrics::LogDeveloperEngagementUkm(
+ ukm_service, source_url(),
+ {AutofillMetrics::FILLABLE_FORM_CONTAINS_TYPE_HINTS,
sebsg 2017/03/29 13:52:58 by looking at the comments of these constants, it
csashi 2017/03/29 16:15:11 Yes, CONTAINS_TYPE_HINTS are a subset of FORM_PARS
sebsg 2017/03/29 17:55:13 I see, I really prefer logging only once if it's a
sebsg 2017/03/29 18:46:09 Ok I talked with Math. Would you mind renaming the
csashi 2017/03/30 00:52:10 Done.
+ AutofillMetrics::FILLABLE_FORM_PARSED});
+ } else {
+ AutofillMetrics::LogDeveloperEngagementUkm(
+ ukm_service, source_url(), {AutofillMetrics::FILLABLE_FORM_PARSED});
}
}
« no previous file with comments | « components/autofill/core/browser/form_structure.h ('k') | components/autofill/core/browser/form_structure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698