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 #include <utility> | 10 #include <utility> |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // Each form interaction event has a separate |UkmEntry|. | 30 // Each form interaction event has a separate |UkmEntry|. |
31 | 31 |
32 // The first form event |UkmEntry| contains metrics for metadata that apply | 32 // The first form event |UkmEntry| contains metrics for metadata that apply |
33 // to all subsequent events. | 33 // to all subsequent events. |
34 extern const char kUKMInteractedWithFormEntryName[]; | 34 extern const char kUKMInteractedWithFormEntryName[]; |
35 extern const char kUKMIsForCreditCardMetricName[]; | 35 extern const char kUKMIsForCreditCardMetricName[]; |
36 extern const char kUKMLocalRecordTypeCountMetricName[]; | 36 extern const char kUKMLocalRecordTypeCountMetricName[]; |
37 extern const char kUKMServerRecordTypeCountMetricName[]; | 37 extern const char kUKMServerRecordTypeCountMetricName[]; |
38 | 38 |
39 // |UkmEntry| when we show suggestions. | 39 // |UkmEntry| when we show suggestions and when user edits text field. See |
| 40 // |kUkmTextFieldDidChangeEntryName|. |
40 extern const char kUKMSuggestionsShownEntryName[]; | 41 extern const char kUKMSuggestionsShownEntryName[]; |
| 42 extern const char kUKMHeuristicTypeMetricName[]; |
| 43 extern const char kUKMHtmlFieldTypeMetricName[]; |
| 44 extern const char kUKMServerTypeMetricName[]; |
41 | 45 |
42 // |UkmEntry| when user selects a masked server credit card. | 46 // |UkmEntry| when user selects a masked server credit card. |
43 extern const char kUKMSelectedMaskedServerCardEntryName[]; | 47 extern const char kUKMSelectedMaskedServerCardEntryName[]; |
44 | 48 |
45 // Each |UkmEntry|, except the first interaction with the form, has a metric for | 49 // Each |UkmEntry|, except the first interaction with the form, has a metric for |
46 // time elapsed, in milliseconds, since we loaded the form. | 50 // time elapsed, in milliseconds, since we loaded the form. |
47 extern const char kUKMMillisecondsSinceFormParsedMetricName[]; | 51 extern const char kUKMMillisecondsSinceFormParsedMetricName[]; |
48 | 52 |
49 // |FormEvent| for FORM_EVENT_*_SUGGESTION_FILLED in credit card forms include a | 53 // |FormEvent| for FORM_EVENT_*_SUGGESTION_FILLED in credit card forms include a |
50 // |CreditCard| |record_type()| to indicate if the suggestion was for a local | 54 // |CreditCard| |record_type()| to indicate if the suggestion was for a local |
51 // card, masked server card or full server card. Similarly, address/profile | 55 // card, masked server card or full server card. Similarly, address/profile |
52 // forms include a |AutofillProfile| |record_type()| to indicate if the | 56 // forms include a |AutofillProfile| |record_type()| to indicate if the |
53 // profile was a local profile or server profile. | 57 // profile was a local profile or server profile. |
54 extern const char kUKMSuggestionFilledEntryName[]; | 58 extern const char kUKMSuggestionFilledEntryName[]; |
55 extern const char kUKMRecordTypeMetricName[]; | 59 extern const char kUKMRecordTypeMetricName[]; |
56 | 60 |
57 // |UkmEntry| for user editing text field. Metrics contain field's attributes. | 61 // |UkmEntry| for user editing text field. Metrics contain field's attributes. |
58 extern const char kUKMTextFieldDidChangeEntryName[]; | 62 extern const char kUKMTextFieldDidChangeEntryName[]; |
59 extern const char kUKMFieldTypeGroupMetricName[]; | 63 extern const char kUKMFieldTypeGroupMetricName[]; |
60 extern const char kUKMHeuristicTypeMetricName[]; | |
61 extern const char kUKMServerTypeMetricName[]; | |
62 extern const char kUKMHtmlFieldTypeMetricName[]; | |
63 extern const char kUKMHtmlFieldModeMetricName[]; | 64 extern const char kUKMHtmlFieldModeMetricName[]; |
64 extern const char kUKMIsAutofilledMetricName[]; | 65 extern const char kUKMIsAutofilledMetricName[]; |
65 extern const char kUKMIsEmptyMetricName[]; | 66 extern const char kUKMIsEmptyMetricName[]; |
66 | 67 |
67 // |UkmEntry| for |AutofillFormSubmittedState|. | 68 // |UkmEntry| for |AutofillFormSubmittedState|. |
68 extern const char kUKMFormSubmittedEntryName[]; | 69 extern const char kUKMFormSubmittedEntryName[]; |
69 extern const char kUKMAutofillFormSubmittedStateMetricName[]; | 70 extern const char kUKMAutofillFormSubmittedStateMetricName[]; |
70 } // namespace internal | 71 } // namespace internal |
71 | 72 |
72 namespace autofill { | 73 namespace autofill { |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 class FormInteractionsUkmLogger { | 623 class FormInteractionsUkmLogger { |
623 public: | 624 public: |
624 explicit FormInteractionsUkmLogger(ukm::UkmRecorder* ukm_recorder); | 625 explicit FormInteractionsUkmLogger(ukm::UkmRecorder* ukm_recorder); |
625 | 626 |
626 const GURL& url() const { return url_; } | 627 const GURL& url() const { return url_; } |
627 | 628 |
628 void OnFormsParsed(const GURL& url); | 629 void OnFormsParsed(const GURL& url); |
629 void LogInteractedWithForm(bool is_for_credit_card, | 630 void LogInteractedWithForm(bool is_for_credit_card, |
630 size_t local_record_type_count, | 631 size_t local_record_type_count, |
631 size_t server_record_type_count); | 632 size_t server_record_type_count); |
632 void LogSuggestionsShown(); | 633 void LogSuggestionsShown(const AutofillField& field); |
633 void LogSelectedMaskedServerCard(); | 634 void LogSelectedMaskedServerCard(); |
634 void LogDidFillSuggestion(int record_type); | 635 void LogDidFillSuggestion(int record_type); |
635 void LogTextFieldDidChange(const AutofillField& field); | 636 void LogTextFieldDidChange(const AutofillField& field); |
636 void LogFormSubmitted(AutofillFormSubmittedState state); | 637 void LogFormSubmitted(AutofillFormSubmittedState state); |
637 | 638 |
638 // We initialize |url_| with the form's URL when we log the first form | 639 // We initialize |url_| with the form's URL when we log the first form |
639 // interaction. Later, we may update |url_| with the |source_url()| for the | 640 // interaction. Later, we may update |url_| with the |source_url()| for the |
640 // submitted form. | 641 // submitted form. |
641 void UpdateSourceURL(const GURL& url); | 642 void UpdateSourceURL(const GURL& url); |
642 | 643 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 } | 853 } |
853 | 854 |
854 inline void set_is_context_secure(bool is_context_secure) { | 855 inline void set_is_context_secure(bool is_context_secure) { |
855 is_context_secure_ = is_context_secure; | 856 is_context_secure_ = is_context_secure; |
856 } | 857 } |
857 | 858 |
858 void OnDidInteractWithAutofillableForm(); | 859 void OnDidInteractWithAutofillableForm(); |
859 | 860 |
860 void OnDidPollSuggestions(const FormFieldData& field); | 861 void OnDidPollSuggestions(const FormFieldData& field); |
861 | 862 |
862 void OnDidShowSuggestions(); | 863 void OnDidShowSuggestions(const AutofillField& field); |
863 | 864 |
864 void OnDidSelectMaskedServerCardSuggestion(); | 865 void OnDidSelectMaskedServerCardSuggestion(); |
865 | 866 |
866 // In case of masked cards, caller must make sure this gets called before | 867 // In case of masked cards, caller must make sure this gets called before |
867 // the card is upgraded to a full card. | 868 // the card is upgraded to a full card. |
868 void OnDidFillSuggestion(const CreditCard& credit_card); | 869 void OnDidFillSuggestion(const CreditCard& credit_card); |
869 | 870 |
870 void OnDidFillSuggestion(const AutofillProfile& profile); | 871 void OnDidFillSuggestion(const AutofillProfile& profile); |
871 | 872 |
872 void OnWillSubmitForm(); | 873 void OnWillSubmitForm(); |
(...skipping 25 matching lines...) Expand all Loading... |
898 | 899 |
899 private: | 900 private: |
900 static const int kNumCardUploadDecisionMetrics = 12; | 901 static const int kNumCardUploadDecisionMetrics = 12; |
901 | 902 |
902 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 903 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
903 }; | 904 }; |
904 | 905 |
905 } // namespace autofill | 906 } // namespace autofill |
906 | 907 |
907 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 908 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
OLD | NEW |