| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/autofill/core/browser/form_structure.h" | 5 #include "components/autofill/core/browser/form_structure.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 for (const auto& field : fields_) { | 371 for (const auto& field : fields_) { |
| 372 const auto iter = field_type_map.find(field->unique_name()); | 372 const auto iter = field_type_map.find(field->unique_name()); |
| 373 if (iter != field_type_map.end()) | 373 if (iter != field_type_map.end()) |
| 374 field->set_heuristic_type(iter->second.BestHeuristicType()); | 374 field->set_heuristic_type(iter->second.BestHeuristicType()); |
| 375 } | 375 } |
| 376 } | 376 } |
| 377 | 377 |
| 378 UpdateAutofillCount(); | 378 UpdateAutofillCount(); |
| 379 IdentifySections(has_author_specified_sections_); | 379 IdentifySections(has_author_specified_sections_); |
| 380 | 380 |
| 381 std::vector<AutofillMetrics::DeveloperEngagementMetric> metrics; | 381 int developer_engagement_metrics = 0; |
| 382 if (IsAutofillable()) { | 382 if (IsAutofillable()) { |
| 383 AutofillMetrics::DeveloperEngagementMetric metric = | 383 AutofillMetrics::DeveloperEngagementMetric metric = |
| 384 has_author_specified_types_ | 384 has_author_specified_types_ |
| 385 ? AutofillMetrics::FILLABLE_FORM_PARSED_WITH_TYPE_HINTS | 385 ? AutofillMetrics::FILLABLE_FORM_PARSED_WITH_TYPE_HINTS |
| 386 : AutofillMetrics::FILLABLE_FORM_PARSED_WITHOUT_TYPE_HINTS; | 386 : AutofillMetrics::FILLABLE_FORM_PARSED_WITHOUT_TYPE_HINTS; |
| 387 metrics.push_back(metric); | 387 developer_engagement_metrics |= 1 << metric; |
| 388 AutofillMetrics::LogDeveloperEngagementMetric(metric); | 388 AutofillMetrics::LogDeveloperEngagementMetric(metric); |
| 389 } | 389 } |
| 390 | 390 |
| 391 if (has_author_specified_upi_vpa_hint_) { | 391 if (has_author_specified_upi_vpa_hint_) { |
| 392 AutofillMetrics::LogDeveloperEngagementMetric( | 392 AutofillMetrics::LogDeveloperEngagementMetric( |
| 393 AutofillMetrics::FORM_CONTAINS_UPI_VPA_HINT); | 393 AutofillMetrics::FORM_CONTAINS_UPI_VPA_HINT); |
| 394 metrics.push_back(AutofillMetrics::FORM_CONTAINS_UPI_VPA_HINT); | 394 developer_engagement_metrics |= |
| 395 1 << AutofillMetrics::FORM_CONTAINS_UPI_VPA_HINT; |
| 395 } | 396 } |
| 396 | 397 |
| 397 AutofillMetrics::LogDeveloperEngagementUkm(ukm_service, source_url(), | 398 if (developer_engagement_metrics) |
| 398 metrics); | 399 AutofillMetrics::LogDeveloperEngagementUkm(ukm_service, source_url(), |
| 400 developer_engagement_metrics); |
| 399 | 401 |
| 400 AutofillMetrics::LogDetermineHeuristicTypesTiming( | 402 AutofillMetrics::LogDetermineHeuristicTypesTiming( |
| 401 base::TimeTicks::Now() - determine_heuristic_types_start_time); | 403 base::TimeTicks::Now() - determine_heuristic_types_start_time); |
| 402 } | 404 } |
| 403 | 405 |
| 404 bool FormStructure::EncodeUploadRequest( | 406 bool FormStructure::EncodeUploadRequest( |
| 405 const ServerFieldTypeSet& available_field_types, | 407 const ServerFieldTypeSet& available_field_types, |
| 406 bool form_was_autofilled, | 408 bool form_was_autofilled, |
| 407 const std::string& login_form_signature, | 409 const std::string& login_form_signature, |
| 408 bool observed_submission, | 410 bool observed_submission, |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 filtered_strings[0].at(prefix_len)) { | 1383 filtered_strings[0].at(prefix_len)) { |
| 1382 // Mismatch found. | 1384 // Mismatch found. |
| 1383 return filtered_strings[i].substr(0, prefix_len); | 1385 return filtered_strings[i].substr(0, prefix_len); |
| 1384 } | 1386 } |
| 1385 } | 1387 } |
| 1386 } | 1388 } |
| 1387 return filtered_strings[0]; | 1389 return filtered_strings[0]; |
| 1388 } | 1390 } |
| 1389 | 1391 |
| 1390 } // namespace autofill | 1392 } // namespace autofill |
| OLD | NEW |