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