| 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 FORM_EVENT_LOCAL_SUGGESTION_WILL_SUBMIT_ONCE, | 535 FORM_EVENT_LOCAL_SUGGESTION_WILL_SUBMIT_ONCE, |
| 536 FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, | 536 FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, |
| 537 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, | 537 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, |
| 538 // A dropdown with suggestions was shown and a form was submitted after | 538 // A dropdown with suggestions was shown and a form was submitted after |
| 539 // that. | 539 // that. |
| 540 FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, | 540 FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, |
| 541 // A dropdown with suggestions was shown and a form is about to be | 541 // A dropdown with suggestions was shown and a form is about to be |
| 542 // submitted. If the submission is not interrupted by JavaScript, the "form | 542 // submitted. If the submission is not interrupted by JavaScript, the "form |
| 543 // submitted" event above will also be logged. | 543 // submitted" event above will also be logged. |
| 544 FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, | 544 FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, |
| 545 NUM_FORM_EVENTS, |
| 546 }; |
| 545 | 547 |
| 546 NUM_FORM_EVENTS, | 548 // Form Events for autofill with bank name available for display. |
| 549 enum BankNameDisplayedFormEvent { |
| 550 // A dropdown with suggestions was shown and at least one suggestion has a |
| 551 // bank name. |
| 552 FORM_EVENT_SUGGESTIONS_SHOWN_WITH_BANK_NAME_AVAILABLE_ONCE = 0, |
| 553 // A server suggestion was used to fill the form and at least one suggestion |
| 554 // has a bank name |
| 555 FORM_EVENT_SERVER_SUGGESTION_FILLED_WITH_BANK_NAME_AVAILABLE_ONCE, |
| 556 BANK_NAME_NUM_FORM_EVENTS, |
| 547 }; | 557 }; |
| 548 | 558 |
| 549 // Events related to the Unmask Credit Card Prompt. | 559 // Events related to the Unmask Credit Card Prompt. |
| 550 enum UnmaskPromptEvent { | 560 enum UnmaskPromptEvent { |
| 551 // The prompt was shown. | 561 // The prompt was shown. |
| 552 UNMASK_PROMPT_SHOWN = 0, | 562 UNMASK_PROMPT_SHOWN = 0, |
| 553 // The prompt was closed without attempting to unmask the card. | 563 // The prompt was closed without attempting to unmask the card. |
| 554 UNMASK_PROMPT_CLOSED_NO_ATTEMPTS, | 564 UNMASK_PROMPT_CLOSED_NO_ATTEMPTS, |
| 555 // The prompt was closed without unmasking the card, but with at least | 565 // The prompt was closed without unmasking the card, but with at least |
| 556 // one attempt. The last failure was retriable. | 566 // one attempt. The last failure was retriable. |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 // In case of masked cards, caller must make sure this gets called before | 940 // In case of masked cards, caller must make sure this gets called before |
| 931 // the card is upgraded to a full card. | 941 // the card is upgraded to a full card. |
| 932 void OnDidFillSuggestion(const CreditCard& credit_card); | 942 void OnDidFillSuggestion(const CreditCard& credit_card); |
| 933 | 943 |
| 934 void OnDidFillSuggestion(const AutofillProfile& profile); | 944 void OnDidFillSuggestion(const AutofillProfile& profile); |
| 935 | 945 |
| 936 void OnWillSubmitForm(); | 946 void OnWillSubmitForm(); |
| 937 | 947 |
| 938 void OnFormSubmitted(); | 948 void OnFormSubmitted(); |
| 939 | 949 |
| 950 void SetBankNameAvailable(); |
| 940 private: | 951 private: |
| 941 void Log(FormEvent event) const; | 952 void Log(FormEvent event) const; |
| 953 void Log(BankNameDisplayedFormEvent event) const; |
| 942 | 954 |
| 943 bool is_for_credit_card_; | 955 bool is_for_credit_card_; |
| 944 size_t server_record_type_count_; | 956 size_t server_record_type_count_; |
| 945 size_t local_record_type_count_; | 957 size_t local_record_type_count_; |
| 946 bool is_context_secure_; | 958 bool is_context_secure_; |
| 947 bool has_logged_interacted_; | 959 bool has_logged_interacted_; |
| 948 bool has_logged_suggestions_shown_; | 960 bool has_logged_suggestions_shown_; |
| 949 bool has_logged_masked_server_card_suggestion_selected_; | 961 bool has_logged_masked_server_card_suggestion_selected_; |
| 950 bool has_logged_suggestion_filled_; | 962 bool has_logged_suggestion_filled_; |
| 951 bool has_logged_will_submit_; | 963 bool has_logged_will_submit_; |
| 952 bool has_logged_submitted_; | 964 bool has_logged_submitted_; |
| 965 bool has_logged_bank_name_available_; |
| 953 bool logged_suggestion_filled_was_server_data_; | 966 bool logged_suggestion_filled_was_server_data_; |
| 954 bool logged_suggestion_filled_was_masked_server_card_; | 967 bool logged_suggestion_filled_was_masked_server_card_; |
| 955 | 968 |
| 956 // The last field that was polled for suggestions. | 969 // The last field that was polled for suggestions. |
| 957 FormFieldData last_polled_field_; | 970 FormFieldData last_polled_field_; |
| 958 | 971 |
| 959 FormInteractionsUkmLogger* | 972 FormInteractionsUkmLogger* |
| 960 form_interactions_ukm_logger_; // Weak reference. | 973 form_interactions_ukm_logger_; // Weak reference. |
| 961 }; | 974 }; |
| 962 | 975 |
| 963 private: | 976 private: |
| 964 static const int kNumCardUploadDecisionMetrics = 12; | 977 static const int kNumCardUploadDecisionMetrics = 12; |
| 965 | 978 |
| 966 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 979 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
| 967 }; | 980 }; |
| 968 | 981 |
| 969 } // namespace autofill | 982 } // namespace autofill |
| 970 | 983 |
| 971 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 984 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
| OLD | NEW |