| 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 #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 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // Our heuristics detected at least one auto-fillable field, and the server | 188 // Our heuristics detected at least one auto-fillable field, and the server |
| 189 // response overrode the type of at least one field. | 189 // response overrode the type of at least one field. |
| 190 QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, | 190 QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, |
| 191 | 191 |
| 192 // Our heuristics did not detect any auto-fillable fields, but the server | 192 // Our heuristics did not detect any auto-fillable fields, but the server |
| 193 // response did detect at least one. | 193 // response did detect at least one. |
| 194 QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, | 194 QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, |
| 195 NUM_SERVER_QUERY_METRICS, | 195 NUM_SERVER_QUERY_METRICS, |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 // Logs usage of "Scan card" control item. |
| 199 enum ScanCreditCardPromptMetric { |
| 200 // "Scan card" was presented to the user. |
| 201 SCAN_CARD_ITEM_SHOWN, |
| 202 // "Scan card" was selected by the user. |
| 203 SCAN_CARD_ITEM_SELECTED, |
| 204 // The user selected something in the dropdown besides "scan card". |
| 205 SCAN_CARD_OTHER_ITEM_SELECTED, |
| 206 NUM_SCAN_CREDIT_CARD_PROMPT_METRICS, |
| 207 }; |
| 208 |
| 198 // Each of these metrics is logged only for potentially autofillable forms, | 209 // Each of these metrics is logged only for potentially autofillable forms, |
| 199 // i.e. forms with at least three fields, etc. | 210 // i.e. forms with at least three fields, etc. |
| 200 // These are used to derive certain "user happiness" metrics. For example, we | 211 // These are used to derive certain "user happiness" metrics. For example, we |
| 201 // can compute the ratio (USER_DID_EDIT_AUTOFILLED_FIELD / USER_DID_AUTOFILL) | 212 // can compute the ratio (USER_DID_EDIT_AUTOFILLED_FIELD / USER_DID_AUTOFILL) |
| 202 // to see how often users have to correct autofilled data. | 213 // to see how often users have to correct autofilled data. |
| 203 enum UserHappinessMetric { | 214 enum UserHappinessMetric { |
| 204 // Loaded a page containing forms. | 215 // Loaded a page containing forms. |
| 205 FORMS_LOADED, | 216 FORMS_LOADED, |
| 206 // Submitted a fillable form -- i.e. one with at least three field values | 217 // Submitted a fillable form -- i.e. one with at least three field values |
| 207 // that match the user's stored Autofill data -- and all matching fields | 218 // that match the user's stored Autofill data -- and all matching fields |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 VERIFY_CVV, | 315 VERIFY_CVV, |
| 305 INVALID_FORM_FIELD, | 316 INVALID_FORM_FIELD, |
| 306 REQUIRE_PHONE_NUMBER, | 317 REQUIRE_PHONE_NUMBER, |
| 307 NUM_WALLET_REQUIRED_ACTIONS | 318 NUM_WALLET_REQUIRED_ACTIONS |
| 308 }; | 319 }; |
| 309 | 320 |
| 310 AutofillMetrics(); | 321 AutofillMetrics(); |
| 311 virtual ~AutofillMetrics(); | 322 virtual ~AutofillMetrics(); |
| 312 | 323 |
| 313 static void LogCreditCardInfoBarMetric(InfoBarMetric metric); | 324 static void LogCreditCardInfoBarMetric(InfoBarMetric metric); |
| 325 static void LogScanCreditCardPromptMetric(ScanCreditCardPromptMetric metric); |
| 314 | 326 |
| 315 virtual void LogDeveloperEngagementMetric( | 327 virtual void LogDeveloperEngagementMetric( |
| 316 DeveloperEngagementMetric metric) const; | 328 DeveloperEngagementMetric metric) const; |
| 317 | 329 |
| 318 virtual void LogHeuristicTypePrediction(FieldTypeQualityMetric metric, | 330 virtual void LogHeuristicTypePrediction(FieldTypeQualityMetric metric, |
| 319 ServerFieldType field_type) const; | 331 ServerFieldType field_type) const; |
| 320 virtual void LogOverallTypePrediction(FieldTypeQualityMetric metric, | 332 virtual void LogOverallTypePrediction(FieldTypeQualityMetric metric, |
| 321 ServerFieldType field_type) const; | 333 ServerFieldType field_type) const; |
| 322 virtual void LogServerTypePrediction(FieldTypeQualityMetric metric, | 334 virtual void LogServerTypePrediction(FieldTypeQualityMetric metric, |
| 323 ServerFieldType field_type) const; | 335 ServerFieldType field_type) const; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 // form. | 419 // form. |
| 408 virtual void LogAddressSuggestionsCount(size_t num_suggestions) const; | 420 virtual void LogAddressSuggestionsCount(size_t num_suggestions) const; |
| 409 | 421 |
| 410 private: | 422 private: |
| 411 DISALLOW_COPY_AND_ASSIGN(AutofillMetrics); | 423 DISALLOW_COPY_AND_ASSIGN(AutofillMetrics); |
| 412 }; | 424 }; |
| 413 | 425 |
| 414 } // namespace autofill | 426 } // namespace autofill |
| 415 | 427 |
| 416 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 428 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
| OLD | NEW |