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 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 AUTOFILL_PROFILE_ACTION_ENUM_SIZE); | 676 AUTOFILL_PROFILE_ACTION_ENUM_SIZE); |
677 } | 677 } |
678 | 678 |
679 // static | 679 // static |
680 void AutofillMetrics::LogAutofillFormSubmittedState( | 680 void AutofillMetrics::LogAutofillFormSubmittedState( |
681 AutofillFormSubmittedState state) { | 681 AutofillFormSubmittedState state) { |
682 UMA_HISTOGRAM_ENUMERATION("Autofill.FormSubmittedState", state, | 682 UMA_HISTOGRAM_ENUMERATION("Autofill.FormSubmittedState", state, |
683 AUTOFILL_FORM_SUBMITTED_STATE_ENUM_SIZE); | 683 AUTOFILL_FORM_SUBMITTED_STATE_ENUM_SIZE); |
684 } | 684 } |
685 | 685 |
686 // static | |
687 void AutofillMetrics::LogPayloadCompressionRatio( | |
688 int compression_ratio, | |
689 AutofillDownloadManager::RequestType type) { | |
690 switch (type) { | |
691 case AutofillDownloadManager::REQUEST_QUERY: | |
692 UMA_HISTOGRAM_PERCENTAGE("Autofill.PayloadCompressionRatio.Query", | |
693 compression_ratio); | |
694 break; | |
695 case AutofillDownloadManager::REQUEST_UPLOAD: | |
696 UMA_HISTOGRAM_PERCENTAGE("Autofill.PayloadCompressionRatio.Upload", | |
697 compression_ratio); | |
698 break; | |
699 } | |
700 } | |
701 | |
702 AutofillMetrics::FormEventLogger::FormEventLogger(bool is_for_credit_card) | 686 AutofillMetrics::FormEventLogger::FormEventLogger(bool is_for_credit_card) |
703 : is_for_credit_card_(is_for_credit_card), | 687 : is_for_credit_card_(is_for_credit_card), |
704 is_server_data_available_(false), | 688 is_server_data_available_(false), |
705 is_local_data_available_(false), | 689 is_local_data_available_(false), |
706 has_logged_interacted_(false), | 690 has_logged_interacted_(false), |
707 has_logged_suggestions_shown_(false), | 691 has_logged_suggestions_shown_(false), |
708 has_logged_masked_server_card_suggestion_selected_(false), | 692 has_logged_masked_server_card_suggestion_selected_(false), |
709 has_logged_suggestion_filled_(false), | 693 has_logged_suggestion_filled_(false), |
710 has_logged_will_submit_(false), | 694 has_logged_will_submit_(false), |
711 has_logged_submitted_(false), | 695 has_logged_submitted_(false), |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 else if (is_server_data_available_ && !is_local_data_available_) | 829 else if (is_server_data_available_ && !is_local_data_available_) |
846 name += ".WithOnlyServerData"; | 830 name += ".WithOnlyServerData"; |
847 else if (!is_server_data_available_ && is_local_data_available_) | 831 else if (!is_server_data_available_ && is_local_data_available_) |
848 name += ".WithOnlyLocalData"; | 832 name += ".WithOnlyLocalData"; |
849 else | 833 else |
850 name += ".WithBothServerAndLocalData"; | 834 name += ".WithBothServerAndLocalData"; |
851 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); | 835 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); |
852 } | 836 } |
853 | 837 |
854 } // namespace autofill | 838 } // namespace autofill |
OLD | NEW |