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