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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "components/autofill/core/browser/autofill_client.h" | 12 #include "components/autofill/core/browser/autofill_client.h" |
13 #include "components/autofill/core/browser/autofill_profile.h" | 13 #include "components/autofill/core/browser/autofill_profile.h" |
14 #include "components/autofill/core/browser/credit_card.h" | 14 #include "components/autofill/core/browser/credit_card.h" |
15 #include "components/autofill/core/browser/field_types.h" | 15 #include "components/autofill/core/browser/field_types.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class TimeDelta; | 18 class TimeDelta; |
19 } | 19 } |
20 | 20 |
21 namespace autofill { | 21 namespace autofill { |
22 | 22 |
23 class AutofillMetrics { | 23 class AutofillMetrics { |
24 public: | 24 public: |
25 enum AutofillProfileAction { | |
26 EXISTING_PROFILE_USED, | |
27 EXISTING_PROFILE_UPDATED, | |
28 NEW_PROFILE_CREATED, | |
rkaplow
2015/10/07 15:04:56
should have something like
AUTOFILL_PROFILE_ACTION
sebsg
2015/10/08 14:55:05
Done.
| |
29 }; | |
30 | |
25 enum DeveloperEngagementMetric { | 31 enum DeveloperEngagementMetric { |
26 // Parsed a form that is potentially autofillable. | 32 // Parsed a form that is potentially autofillable. |
27 FILLABLE_FORM_PARSED = 0, | 33 FILLABLE_FORM_PARSED = 0, |
28 // Parsed a form that is potentially autofillable and contains at least one | 34 // Parsed a form that is potentially autofillable and contains at least one |
29 // web developer-specified field type hint, a la | 35 // web developer-specified field type hint, a la |
30 // http://is.gd/whatwg_autocomplete | 36 // http://is.gd/whatwg_autocomplete |
31 FILLABLE_FORM_CONTAINS_TYPE_HINTS, | 37 FILLABLE_FORM_CONTAINS_TYPE_HINTS, |
32 NUM_DEVELOPER_ENGAGEMENT_METRICS, | 38 NUM_DEVELOPER_ENGAGEMENT_METRICS, |
33 }; | 39 }; |
34 | 40 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
569 static void LogPasswordFormQueryVolume(PasswordFormQueryVolumeMetric metric); | 575 static void LogPasswordFormQueryVolume(PasswordFormQueryVolumeMetric metric); |
570 | 576 |
571 // Log how many autofilled fields in a given form were edited before | 577 // Log how many autofilled fields in a given form were edited before |
572 // submission. | 578 // submission. |
573 static void LogNumberOfEditedAutofilledFieldsAtSubmission( | 579 static void LogNumberOfEditedAutofilledFieldsAtSubmission( |
574 size_t num_edited_autofilled_fields); | 580 size_t num_edited_autofilled_fields); |
575 | 581 |
576 // This should be called each time a server response is parsed for a form. | 582 // This should be called each time a server response is parsed for a form. |
577 static void LogServerResponseHasDataForForm(bool has_data); | 583 static void LogServerResponseHasDataForForm(bool has_data); |
578 | 584 |
579 // This should be called at each form submission to indicate whether a new | 585 // This should be called at each form submission to indicate what profile |
580 // profile was created. | 586 // action happened. |
581 static void LogAutomaticProfileCreation(bool created); | 587 static void LogProfileActionOnFormSubmitted(AutofillProfileAction action); |
582 | 588 |
583 // Utility to autofill form events in the relevant histograms depending on | 589 // Utility to autofill form events in the relevant histograms depending on |
584 // the presence of server and/or local data. | 590 // the presence of server and/or local data. |
585 class FormEventLogger { | 591 class FormEventLogger { |
586 public: | 592 public: |
587 FormEventLogger(bool is_for_credit_card); | 593 FormEventLogger(bool is_for_credit_card); |
588 | 594 |
589 inline void set_is_server_data_available(bool is_server_data_available) { | 595 inline void set_is_server_data_available(bool is_server_data_available) { |
590 is_server_data_available_ = is_server_data_available; | 596 is_server_data_available_ = is_server_data_available; |
591 } | 597 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 bool logged_suggestion_filled_was_masked_server_card_; | 632 bool logged_suggestion_filled_was_masked_server_card_; |
627 }; | 633 }; |
628 | 634 |
629 private: | 635 private: |
630 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 636 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
631 }; | 637 }; |
632 | 638 |
633 } // namespace autofill | 639 } // namespace autofill |
634 | 640 |
635 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 641 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
OLD | NEW |