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

Unified Diff: components/autofill/core/browser/form_structure.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/form_structure.cc
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc
index 282a59aa9324e4f94d2de78a8899e081c005b4c7..496257e4824868507bf4008a79c5e39304b83b2f 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 {
@@ -336,7 +337,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|
@@ -362,12 +363,13 @@ void FormStructure::DetermineHeuristicTypes() {
IdentifySections(has_author_specified_sections_);
if (IsAutofillable()) {
- AutofillMetrics::LogDeveloperEngagementMetric(
- AutofillMetrics::FILLABLE_FORM_PARSED);
- if (has_author_specified_types_) {
- AutofillMetrics::LogDeveloperEngagementMetric(
- AutofillMetrics::FILLABLE_FORM_CONTAINS_TYPE_HINTS);
- }
+ const auto metric =
+ has_author_specified_types_
+ ? AutofillMetrics::FILLABLE_FORM_PARSED_WITH_TYPE_HINTS
+ : AutofillMetrics::FILLABLE_FORM_PARSED_WITHOUT_TYPE_HINTS;
+ AutofillMetrics::LogDeveloperEngagementMetric(metric);
+ AutofillMetrics::LogDeveloperEngagementUkm(ukm_service, source_url(),
+ metric);
}
if (has_author_specified_upi_vpa_hint_) {
« 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