Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: components/autofill/core/browser/autofill_metrics.h

Issue 2711543002: Experiment to add bank name in autofill ui. (Closed)
Patch Set: Fix and add more metrics unit tests Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 545 // A dropdown with suggestions was shown and suggestions have bank names.
546 FORM_EVENT_SUGGESTIONS_SHOWN_WITH_BANK_NAME_AVAILABLE_ONCE,
sebsg 2017/06/12 21:17:00 Since it's for an experiment, I would prefer the m
Shanfeng 2017/06/12 23:34:58 Do you mean create a new FormEvent like: enum Bank
sebsg 2017/06/13 13:36:04 yep I'd prefer that :)
547 // A server suggestion was used to fill the form and suggestions have bank
548 // names.
549 FORM_EVENT_SERVER_SUGGESTION_FILLED_WITH_BANK_NAME_AVAILABLE_ONCE,
546 NUM_FORM_EVENTS, 550 NUM_FORM_EVENTS,
547 }; 551 };
548 552
549 // Events related to the Unmask Credit Card Prompt. 553 // Events related to the Unmask Credit Card Prompt.
550 enum UnmaskPromptEvent { 554 enum UnmaskPromptEvent {
551 // The prompt was shown. 555 // The prompt was shown.
552 UNMASK_PROMPT_SHOWN = 0, 556 UNMASK_PROMPT_SHOWN = 0,
553 // The prompt was closed without attempting to unmask the card. 557 // The prompt was closed without attempting to unmask the card.
554 UNMASK_PROMPT_CLOSED_NO_ATTEMPTS, 558 UNMASK_PROMPT_CLOSED_NO_ATTEMPTS,
555 // The prompt was closed without unmasking the card, but with at least 559 // The prompt was closed without unmasking the card, but with at least
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 // In case of masked cards, caller must make sure this gets called before 934 // In case of masked cards, caller must make sure this gets called before
931 // the card is upgraded to a full card. 935 // the card is upgraded to a full card.
932 void OnDidFillSuggestion(const CreditCard& credit_card); 936 void OnDidFillSuggestion(const CreditCard& credit_card);
933 937
934 void OnDidFillSuggestion(const AutofillProfile& profile); 938 void OnDidFillSuggestion(const AutofillProfile& profile);
935 939
936 void OnWillSubmitForm(); 940 void OnWillSubmitForm();
937 941
938 void OnFormSubmitted(); 942 void OnFormSubmitted();
939 943
944 void SetBankNameAvailable();
940 private: 945 private:
941 void Log(FormEvent event) const; 946 void Log(FormEvent event) const;
942 947
943 bool is_for_credit_card_; 948 bool is_for_credit_card_;
944 size_t server_record_type_count_; 949 size_t server_record_type_count_;
945 size_t local_record_type_count_; 950 size_t local_record_type_count_;
946 bool is_context_secure_; 951 bool is_context_secure_;
947 bool has_logged_interacted_; 952 bool has_logged_interacted_;
948 bool has_logged_suggestions_shown_; 953 bool has_logged_suggestions_shown_;
949 bool has_logged_masked_server_card_suggestion_selected_; 954 bool has_logged_masked_server_card_suggestion_selected_;
950 bool has_logged_suggestion_filled_; 955 bool has_logged_suggestion_filled_;
951 bool has_logged_will_submit_; 956 bool has_logged_will_submit_;
952 bool has_logged_submitted_; 957 bool has_logged_submitted_;
958 bool has_logged_bank_name_available_;
953 bool logged_suggestion_filled_was_server_data_; 959 bool logged_suggestion_filled_was_server_data_;
954 bool logged_suggestion_filled_was_masked_server_card_; 960 bool logged_suggestion_filled_was_masked_server_card_;
955 961
956 // The last field that was polled for suggestions. 962 // The last field that was polled for suggestions.
957 FormFieldData last_polled_field_; 963 FormFieldData last_polled_field_;
958 964
959 FormInteractionsUkmLogger* 965 FormInteractionsUkmLogger*
960 form_interactions_ukm_logger_; // Weak reference. 966 form_interactions_ukm_logger_; // Weak reference.
961 }; 967 };
962 968
963 private: 969 private:
964 static const int kNumCardUploadDecisionMetrics = 12; 970 static const int kNumCardUploadDecisionMetrics = 12;
965 971
966 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); 972 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics);
967 }; 973 };
968 974
969 } // namespace autofill 975 } // namespace autofill
970 976
971 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 977 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698