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

Side by Side Diff: components/autofill/core/browser/autofill_metrics.h

Issue 2849753002: Logs all reasons card upload was not offered in UKM and UMA. (Closed)
Patch Set: Encodes enum metrics as bitmask. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 enum AutofillFormSubmittedState { 88 enum AutofillFormSubmittedState {
89 NON_FILLABLE_FORM_OR_NEW_DATA, 89 NON_FILLABLE_FORM_OR_NEW_DATA,
90 FILLABLE_FORM_AUTOFILLED_ALL, 90 FILLABLE_FORM_AUTOFILLED_ALL,
91 FILLABLE_FORM_AUTOFILLED_SOME, 91 FILLABLE_FORM_AUTOFILLED_SOME,
92 FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS, 92 FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS,
93 FILLABLE_FORM_AUTOFILLED_NONE_DID_NOT_SHOW_SUGGESTIONS, 93 FILLABLE_FORM_AUTOFILLED_NONE_DID_NOT_SHOW_SUGGESTIONS,
94 AUTOFILL_FORM_SUBMITTED_STATE_ENUM_SIZE, 94 AUTOFILL_FORM_SUBMITTED_STATE_ENUM_SIZE,
95 }; 95 };
96 96
97 enum CardUploadDecisionMetric { 97 enum CardUploadDecisionMetric {
98 // All the required conditions were satisfied and the card upload prompt was 98 // Card upload prompt was triggered either because all the conditions were
99 // triggered. 99 // automatically satisfied or because we can potentially fix fields to
100 // satisfy some conditions. For example, requesting user to input CVC when
101 // CVC was missing. See |UPLOAD_OFFERED_NO_CVC|.
100 UPLOAD_OFFERED, 102 UPLOAD_OFFERED,
101 // No CVC was detected. We don't know whether any addresses were available 103 // No CVC was detected. We don't know whether any addresses were available
102 // nor whether we would have been able to get upload details. 104 // nor whether we would have been able to get upload details.
103 UPLOAD_NOT_OFFERED_NO_CVC, 105 UPLOAD_NOT_OFFERED_NO_CVC,
104 // A CVC was detected but no recently created or used address was available. 106 // A CVC was detected but no recently created or used address was available.
105 // We don't know whether we would have been able to get upload details. 107 // We don't know whether we would have been able to get upload details.
106 UPLOAD_NOT_OFFERED_NO_ADDRESS, 108 UPLOAD_NOT_OFFERED_NO_ADDRESS,
107 // A CVC and one or more addresses were available but no name was found on 109 // A CVC and one or more addresses were available but no name was found on
108 // either the card or the adress(es). We don't know whether the address(es) 110 // either the card or the adress(es). We don't know whether the address(es)
109 // were otherwise valid nor whether we would have been able to get upload 111 // were otherwise valid nor whether we would have been able to get upload
(...skipping 11 matching lines...) Expand all
121 // request to Payments for upload details failed. 123 // request to Payments for upload details failed.
122 UPLOAD_NOT_OFFERED_GET_UPLOAD_DETAILS_FAILED, 124 UPLOAD_NOT_OFFERED_GET_UPLOAD_DETAILS_FAILED,
123 // A CVC and one or more addresses were available but the names on the card 125 // A CVC and one or more addresses were available but the names on the card
124 // and/or the addresses didn't match. We don't know whether the address(es) 126 // and/or the addresses didn't match. We don't know whether the address(es)
125 // were otherwise valid nor whether we would have been able to get upload 127 // were otherwise valid nor whether we would have been able to get upload
126 // details. 128 // details.
127 UPLOAD_NOT_OFFERED_CONFLICTING_NAMES, 129 UPLOAD_NOT_OFFERED_CONFLICTING_NAMES,
128 // No CVC was detected, but valid addresses and names were. Upload is still 130 // No CVC was detected, but valid addresses and names were. Upload is still
129 // possible if the user manually enters CVC, so upload was offered. 131 // possible if the user manually enters CVC, so upload was offered.
130 UPLOAD_OFFERED_NO_CVC, 132 UPLOAD_OFFERED_NO_CVC,
133 // One or more of the required conditions were not satisfied and the card
134 // upload prompt was not triggered.
135 UPLOAD_NOT_OFFERED,
131 NUM_CARD_UPLOAD_DECISION_METRICS, 136 NUM_CARD_UPLOAD_DECISION_METRICS,
132 }; 137 };
133 138
134 enum DeveloperEngagementMetric { 139 enum DeveloperEngagementMetric {
135 // Parsed a form that is potentially autofillable and does not contain any 140 // Parsed a form that is potentially autofillable and does not contain any
136 // web developer-specified field type hint. 141 // web developer-specified field type hint.
137 FILLABLE_FORM_PARSED_WITHOUT_TYPE_HINTS = 0, 142 FILLABLE_FORM_PARSED_WITHOUT_TYPE_HINTS = 0,
138 // Parsed a form that is potentially autofillable and contains at least one 143 // Parsed a form that is potentially autofillable and contains at least one
139 // web developer-specified field type hint, a la 144 // web developer-specified field type hint, a la
140 // http://is.gd/whatwg_autocomplete 145 // http://is.gd/whatwg_autocomplete
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 static void LogIsQueriedCreditCardFormSecure(bool is_secure); 802 static void LogIsQueriedCreditCardFormSecure(bool is_secure);
798 803
799 // Log how the converted wallet address was added to the local autofill 804 // Log how the converted wallet address was added to the local autofill
800 // profiles. 805 // profiles.
801 static void LogWalletAddressConversionType(WalletAddressConversionType type); 806 static void LogWalletAddressConversionType(WalletAddressConversionType type);
802 807
803 // This should be called when the user selects the Form-Not-Secure warning 808 // This should be called when the user selects the Form-Not-Secure warning
804 // suggestion to show an explanation of the warning. 809 // suggestion to show an explanation of the warning.
805 static void LogShowedHttpNotSecureExplanation(); 810 static void LogShowedHttpNotSecureExplanation();
806 811
807 // Logs the card upload decision ukm based on the specified |url| and 812 // Logs the card upload decisions ukm for the specified |url|.
808 // |upload_decision|. 813 // |upload_decision_metrics| is a bitmask of
809 static void LogCardUploadDecisionUkm( 814 // |AutofillMetrics::CardUploadDecisionMetric|.
810 ukm::UkmService* ukm_service, 815 static void LogCardUploadDecisionsUkm(ukm::UkmService* ukm_service,
811 const GURL& url, 816 const GURL& url,
812 AutofillMetrics::CardUploadDecisionMetric upload_decision); 817 int upload_decision_metrics);
813 818
814 // Logs the developer engagement ukm for the specified |url| and autofill 819 // Logs the developer engagement ukm for the specified |url| and autofill
815 // fields in the form structure. 820 // fields in the form structure. |developer_engagement_metrics| is a bitmask
816 static void LogDeveloperEngagementUkm( 821 // of |AutofillMetrics::DeveloperEngagementMetric|.
817 ukm::UkmService* ukm_service, 822 static void LogDeveloperEngagementUkm(ukm::UkmService* ukm_service,
818 const GURL& url, 823 const GURL& url,
819 std::vector<AutofillMetrics::DeveloperEngagementMetric> metrics); 824 int developer_engagement_metrics);
820 825
821 // Logs the the |ukm_entry_name| with the specified |url| and the specified 826 // Logs the the |ukm_entry_name| with the specified |url| and the specified
822 // |metrics|. Returns whether the ukm was sucessfully logged. 827 // |metrics|. Returns whether the ukm was sucessfully logged.
823 static bool LogUkm(ukm::UkmService* ukm_service, 828 static bool LogUkm(ukm::UkmService* ukm_service,
824 const GURL& url, 829 const GURL& url,
825 const std::string& ukm_entry_name, 830 const std::string& ukm_entry_name,
826 const std::vector<std::pair<const char*, int>>& metrics); 831 const std::vector<std::pair<const char*, int>>& metrics);
827 832
828 // Utility to log autofill form events in the relevant histograms depending on 833 // Utility to log autofill form events in the relevant histograms depending on
829 // the presence of server and/or local data. 834 // the presence of server and/or local data.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 form_interactions_ukm_logger_; // Weak reference. 890 form_interactions_ukm_logger_; // Weak reference.
886 }; 891 };
887 892
888 private: 893 private:
889 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); 894 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics);
890 }; 895 };
891 896
892 } // namespace autofill 897 } // namespace autofill
893 898
894 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 899 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698