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

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

Issue 2711543002: Experiment to add bank name in autofill ui. (Closed)
Patch Set: address comment 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 NUM_FORM_EVENTS,
546 };
545 547
546 NUM_FORM_EVENTS, 548 // Form Events for autofill bank name experiment.
549 enum BankNameExperimentFormEvent {
Mathieu 2017/06/16 18:27:05 I wouldn't put Experiment in the enum name or desc
Shanfeng 2017/06/16 20:51:46 Done.
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
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(BankNameExperimentFormEvent 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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698