Chromium Code Reviews| 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/autofill_metrics.h" | 5 #include "components/autofill/core/browser/autofill_metrics.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 719 NUM_CONVERTED_ADDRESS_CONVERSION_TYPES); | 719 NUM_CONVERTED_ADDRESS_CONVERSION_TYPES); |
| 720 } | 720 } |
| 721 | 721 |
| 722 // static | 722 // static |
| 723 void AutofillMetrics::LogShowedHttpNotSecureExplanation() { | 723 void AutofillMetrics::LogShowedHttpNotSecureExplanation() { |
| 724 base::RecordAction( | 724 base::RecordAction( |
| 725 base::UserMetricsAction("Autofill_ShowedHttpNotSecureExplanation")); | 725 base::UserMetricsAction("Autofill_ShowedHttpNotSecureExplanation")); |
| 726 } | 726 } |
| 727 | 727 |
| 728 // static | 728 // static |
| 729 void AutofillMetrics::LogCardUploadDecisionUkm( | 729 void AutofillMetrics::LogCardUploadDecisionsUkm( |
| 730 ukm::UkmService* ukm_service, | 730 ukm::UkmService* ukm_service, |
| 731 const GURL& url, | 731 const GURL& url, |
| 732 AutofillMetrics::CardUploadDecisionMetric upload_decision) { | 732 const std::vector<AutofillMetrics::CardUploadDecisionMetric>& |
| 733 if (upload_decision >= AutofillMetrics::NUM_CARD_UPLOAD_DECISION_METRICS) | 733 upload_decisions) { |
| 734 return; | 734 std::vector<std::pair<const char*, int>> metrics; |
| 735 | 735 |
| 736 const std::vector<std::pair<const char*, int>> metrics = { | 736 for (const auto it : upload_decisions) { |
| 737 {internal::kUKMCardUploadDecisionMetricName, | 737 DCHECK_LT(it, AutofillMetrics::NUM_CARD_UPLOAD_DECISION_METRICS); |
| 738 static_cast<int>(upload_decision)}}; | 738 metrics.push_back( |
| 739 {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.
| |
| 740 } | |
| 739 LogUkm(ukm_service, url, internal::kUKMCardUploadDecisionEntryName, metrics); | 741 LogUkm(ukm_service, url, internal::kUKMCardUploadDecisionEntryName, metrics); |
| 740 } | 742 } |
| 741 | 743 |
| 742 // static | 744 // static |
| 743 void AutofillMetrics::LogDeveloperEngagementUkm( | 745 void AutofillMetrics::LogDeveloperEngagementUkm( |
| 744 ukm::UkmService* ukm_service, | 746 ukm::UkmService* ukm_service, |
| 745 const GURL& url, | 747 const GURL& url, |
| 746 std::vector<AutofillMetrics::DeveloperEngagementMetric> metrics) { | 748 std::vector<AutofillMetrics::DeveloperEngagementMetric> metrics) { |
| 747 std::vector<std::pair<const char*, int>> form_structure_metrics; | 749 std::vector<std::pair<const char*, int>> form_structure_metrics; |
| 748 for (const auto it : metrics) | 750 for (const auto it : metrics) |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1128 DCHECK(!form_loaded_timestamp_.is_null()); | 1130 DCHECK(!form_loaded_timestamp_.is_null()); |
| 1129 return (base::TimeTicks::Now() - form_loaded_timestamp_).InMilliseconds(); | 1131 return (base::TimeTicks::Now() - form_loaded_timestamp_).InMilliseconds(); |
| 1130 } | 1132 } |
| 1131 | 1133 |
| 1132 void AutofillMetrics::FormInteractionsUkmLogger::GetNewSourceID() { | 1134 void AutofillMetrics::FormInteractionsUkmLogger::GetNewSourceID() { |
| 1133 source_id_ = ukm_service_->GetNewSourceID(); | 1135 source_id_ = ukm_service_->GetNewSourceID(); |
| 1134 ukm_service_->UpdateSourceURL(source_id_, url_); | 1136 ukm_service_->UpdateSourceURL(source_id_, url_); |
| 1135 } | 1137 } |
| 1136 | 1138 |
| 1137 } // namespace autofill | 1139 } // namespace autofill |
| OLD | NEW |