| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // metrics are logged for each fillable field in a submitted form: for | 252 // metrics are logged for each fillable field in a submitted form: for |
| 253 // the heuristic prediction, for the crowd-sourced prediction, and for the | 253 // the heuristic prediction, for the crowd-sourced prediction, and for the |
| 254 // overall prediction. | 254 // overall prediction. |
| 255 enum FieldTypeQualityMetric { | 255 enum FieldTypeQualityMetric { |
| 256 TYPE_UNKNOWN = 0, // Offered no prediction. | 256 TYPE_UNKNOWN = 0, // Offered no prediction. |
| 257 TYPE_MATCH, // Predicted correctly. | 257 TYPE_MATCH, // Predicted correctly. |
| 258 TYPE_MISMATCH, // Predicted incorrectly. | 258 TYPE_MISMATCH, // Predicted incorrectly. |
| 259 NUM_FIELD_TYPE_QUALITY_METRICS, | 259 NUM_FIELD_TYPE_QUALITY_METRICS, |
| 260 }; | 260 }; |
| 261 | 261 |
| 262 enum QualityMetricType { |
| 263 TYPE_SUBMISSION = 0, // Logged based on user's submitted data. |
| 264 TYPE_NO_SUBMISSION, // Logged based on user's entered data. |
| 265 TYPE_AUTOCOMPLETE_BASED, // Logged based on the value of autocomplete attr. |
| 266 NUM_QUALITY_METRIC_TYPES, |
| 267 }; |
| 268 |
| 262 // Each of these is logged at most once per query to the server, which in turn | 269 // Each of these is logged at most once per query to the server, which in turn |
| 263 // occurs at most once per page load. | 270 // occurs at most once per page load. |
| 264 enum ServerQueryMetric { | 271 enum ServerQueryMetric { |
| 265 QUERY_SENT = 0, // Sent a query to the server. | 272 QUERY_SENT = 0, // Sent a query to the server. |
| 266 QUERY_RESPONSE_RECEIVED, // Received a response. | 273 QUERY_RESPONSE_RECEIVED, // Received a response. |
| 267 QUERY_RESPONSE_PARSED, // Successfully parsed the server response. | 274 QUERY_RESPONSE_PARSED, // Successfully parsed the server response. |
| 268 | 275 |
| 269 // The response was parseable, but provided no improvements relative to our | 276 // The response was parseable, but provided no improvements relative to our |
| 270 // heuristics. | 277 // heuristics. |
| 271 QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, | 278 QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 // the time elapsed between launching the credit card scanner and getting back | 521 // the time elapsed between launching the credit card scanner and getting back |
| 515 // the result. |completed| should be true if a credit card was scanned, false | 522 // the result. |completed| should be true if a credit card was scanned, false |
| 516 // if the scan was cancelled. | 523 // if the scan was cancelled. |
| 517 static void LogScanCreditCardCompleted(const base::TimeDelta& duration, | 524 static void LogScanCreditCardCompleted(const base::TimeDelta& duration, |
| 518 bool completed); | 525 bool completed); |
| 519 | 526 |
| 520 static void LogDeveloperEngagementMetric(DeveloperEngagementMetric metric); | 527 static void LogDeveloperEngagementMetric(DeveloperEngagementMetric metric); |
| 521 | 528 |
| 522 static void LogHeuristicTypePrediction(FieldTypeQualityMetric metric, | 529 static void LogHeuristicTypePrediction(FieldTypeQualityMetric metric, |
| 523 ServerFieldType field_type, | 530 ServerFieldType field_type, |
| 524 bool observed_submission); | 531 QualityMetricType metric_type); |
| 525 static void LogOverallTypePrediction(FieldTypeQualityMetric metric, | 532 static void LogOverallTypePrediction(FieldTypeQualityMetric metric, |
| 526 ServerFieldType field_type, | 533 ServerFieldType field_type, |
| 527 bool observed_submission); | 534 QualityMetricType metric_type); |
| 528 static void LogServerTypePrediction(FieldTypeQualityMetric metric, | 535 static void LogServerTypePrediction(FieldTypeQualityMetric metric, |
| 529 ServerFieldType field_type, | 536 ServerFieldType field_type, |
| 530 bool observed_submission); | 537 QualityMetricType metric_type); |
| 531 | 538 |
| 532 static void LogServerQueryMetric(ServerQueryMetric metric); | 539 static void LogServerQueryMetric(ServerQueryMetric metric); |
| 533 | 540 |
| 534 static void LogUserHappinessMetric(UserHappinessMetric metric); | 541 static void LogUserHappinessMetric(UserHappinessMetric metric); |
| 535 | 542 |
| 536 // Logs |event| to the unmask prompt events histogram. | 543 // Logs |event| to the unmask prompt events histogram. |
| 537 static void LogUnmaskPromptEvent(UnmaskPromptEvent event); | 544 static void LogUnmaskPromptEvent(UnmaskPromptEvent event); |
| 538 | 545 |
| 539 // Logs the time elapsed between the unmask prompt being shown and it | 546 // Logs the time elapsed between the unmask prompt being shown and it |
| 540 // being closed. | 547 // being closed. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 bool logged_suggestion_filled_was_masked_server_card_; | 687 bool logged_suggestion_filled_was_masked_server_card_; |
| 681 }; | 688 }; |
| 682 | 689 |
| 683 private: | 690 private: |
| 684 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 691 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
| 685 }; | 692 }; |
| 686 | 693 |
| 687 } // namespace autofill | 694 } // namespace autofill |
| 688 | 695 |
| 689 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 696 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
| OLD | NEW |