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 | 10 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // triggered. Only one of the following four will be triggered per page | 274 // triggered. Only one of the following four will be triggered per page |
275 // load. | 275 // load. |
276 FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, | 276 FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, |
277 FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, | 277 FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, |
278 FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, | 278 FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, |
279 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, | 279 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, |
280 // A masked server card suggestion was selected to fill the form. | 280 // A masked server card suggestion was selected to fill the form. |
281 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED, | 281 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED, |
282 // Same as above but only triggered once per page load. | 282 // Same as above but only triggered once per page load. |
283 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED_ONCE, | 283 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED_ONCE, |
| 284 // An autofillable form is about to be submitted. If the submission is not |
| 285 // interrupted by JavaScript, the "form submitted" events above will also be |
| 286 // logged. Depending on the user filling a local, server, masked server card |
| 287 // or no suggestion one of the following will be triggered, at most once per |
| 288 // page load. |
| 289 FORM_EVENT_NO_SUGGESTION_WILL_SUBMIT_ONCE, |
| 290 FORM_EVENT_LOCAL_SUGGESTION_WILL_SUBMIT_ONCE, |
| 291 FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, |
| 292 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, |
| 293 |
284 NUM_FORM_EVENTS, | 294 NUM_FORM_EVENTS, |
285 }; | 295 }; |
286 | 296 |
287 // Events related to the Unmask Credit Card Prompt. | 297 // Events related to the Unmask Credit Card Prompt. |
288 enum UnmaskPromptEvent { | 298 enum UnmaskPromptEvent { |
289 // The prompt was shown. | 299 // The prompt was shown. |
290 UNMASK_PROMPT_SHOWN = 0, | 300 UNMASK_PROMPT_SHOWN = 0, |
291 // The prompt was closed without attempting to unmask the card. | 301 // The prompt was closed without attempting to unmask the card. |
292 UNMASK_PROMPT_CLOSED_NO_ATTEMPTS, | 302 UNMASK_PROMPT_CLOSED_NO_ATTEMPTS, |
293 // The prompt was closed without unmasking the card, but with at least | 303 // The prompt was closed without unmasking the card, but with at least |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 void OnDidShowSuggestions(); | 549 void OnDidShowSuggestions(); |
540 | 550 |
541 void OnDidSelectMaskedServerCardSuggestion(); | 551 void OnDidSelectMaskedServerCardSuggestion(); |
542 | 552 |
543 // In case of masked cards, caller must make sure this gets called before | 553 // In case of masked cards, caller must make sure this gets called before |
544 // the card is upgraded to a full card. | 554 // the card is upgraded to a full card. |
545 void OnDidFillSuggestion(const CreditCard& credit_card); | 555 void OnDidFillSuggestion(const CreditCard& credit_card); |
546 | 556 |
547 void OnDidFillSuggestion(const AutofillProfile& profile); | 557 void OnDidFillSuggestion(const AutofillProfile& profile); |
548 | 558 |
549 void OnDidSubmitForm(); | 559 void OnWillSubmitForm(); |
| 560 |
| 561 void OnFormSubmitted(); |
550 | 562 |
551 private: | 563 private: |
552 void Log(FormEvent event) const; | 564 void Log(FormEvent event) const; |
553 | 565 |
554 bool is_for_credit_card_; | 566 bool is_for_credit_card_; |
555 bool is_server_data_available_; | 567 bool is_server_data_available_; |
556 bool is_local_data_available_; | 568 bool is_local_data_available_; |
557 bool has_logged_interacted_; | 569 bool has_logged_interacted_; |
558 bool has_logged_suggestions_shown_; | 570 bool has_logged_suggestions_shown_; |
559 bool has_logged_masked_server_card_suggestion_selected_; | 571 bool has_logged_masked_server_card_suggestion_selected_; |
560 bool has_logged_suggestion_filled_; | 572 bool has_logged_suggestion_filled_; |
| 573 bool has_logged_will_submit_; |
561 bool has_logged_submitted_; | 574 bool has_logged_submitted_; |
562 bool logged_suggestion_filled_was_server_data_; | 575 bool logged_suggestion_filled_was_server_data_; |
563 bool logged_suggestion_filled_was_masked_server_card_; | 576 bool logged_suggestion_filled_was_masked_server_card_; |
564 }; | 577 }; |
565 | 578 |
566 private: | 579 private: |
567 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 580 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
568 }; | 581 }; |
569 | 582 |
570 } // namespace autofill | 583 } // namespace autofill |
571 | 584 |
572 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 585 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
OLD | NEW |