| 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, |
| 29 AUTOFILL_PROFILE_ACTION_ENUM_SIZE, |
| 30 }; |
| 31 |
| 25 enum DeveloperEngagementMetric { | 32 enum DeveloperEngagementMetric { |
| 26 // Parsed a form that is potentially autofillable. | 33 // Parsed a form that is potentially autofillable. |
| 27 FILLABLE_FORM_PARSED = 0, | 34 FILLABLE_FORM_PARSED = 0, |
| 28 // Parsed a form that is potentially autofillable and contains at least one | 35 // Parsed a form that is potentially autofillable and contains at least one |
| 29 // web developer-specified field type hint, a la | 36 // web developer-specified field type hint, a la |
| 30 // http://is.gd/whatwg_autocomplete | 37 // http://is.gd/whatwg_autocomplete |
| 31 FILLABLE_FORM_CONTAINS_TYPE_HINTS, | 38 FILLABLE_FORM_CONTAINS_TYPE_HINTS, |
| 32 NUM_DEVELOPER_ENGAGEMENT_METRICS, | 39 NUM_DEVELOPER_ENGAGEMENT_METRICS, |
| 33 }; | 40 }; |
| 34 | 41 |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 static void LogPasswordFormQueryVolume(PasswordFormQueryVolumeMetric metric); | 579 static void LogPasswordFormQueryVolume(PasswordFormQueryVolumeMetric metric); |
| 573 | 580 |
| 574 // Log how many autofilled fields in a given form were edited before | 581 // Log how many autofilled fields in a given form were edited before |
| 575 // submission. | 582 // submission. |
| 576 static void LogNumberOfEditedAutofilledFieldsAtSubmission( | 583 static void LogNumberOfEditedAutofilledFieldsAtSubmission( |
| 577 size_t num_edited_autofilled_fields); | 584 size_t num_edited_autofilled_fields); |
| 578 | 585 |
| 579 // This should be called each time a server response is parsed for a form. | 586 // This should be called each time a server response is parsed for a form. |
| 580 static void LogServerResponseHasDataForForm(bool has_data); | 587 static void LogServerResponseHasDataForForm(bool has_data); |
| 581 | 588 |
| 582 // This should be called at each form submission to indicate whether a new | 589 // This should be called at each form submission to indicate what profile |
| 583 // profile was created. | 590 // action happened. |
| 584 static void LogAutomaticProfileCreation(bool created); | 591 static void LogProfileActionOnFormSubmitted(AutofillProfileAction action); |
| 585 | 592 |
| 586 // Utility to autofill form events in the relevant histograms depending on | 593 // Utility to autofill form events in the relevant histograms depending on |
| 587 // the presence of server and/or local data. | 594 // the presence of server and/or local data. |
| 588 class FormEventLogger { | 595 class FormEventLogger { |
| 589 public: | 596 public: |
| 590 FormEventLogger(bool is_for_credit_card); | 597 FormEventLogger(bool is_for_credit_card); |
| 591 | 598 |
| 592 inline void set_is_server_data_available(bool is_server_data_available) { | 599 inline void set_is_server_data_available(bool is_server_data_available) { |
| 593 is_server_data_available_ = is_server_data_available; | 600 is_server_data_available_ = is_server_data_available; |
| 594 } | 601 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 bool logged_suggestion_filled_was_masked_server_card_; | 636 bool logged_suggestion_filled_was_masked_server_card_; |
| 630 }; | 637 }; |
| 631 | 638 |
| 632 private: | 639 private: |
| 633 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 640 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
| 634 }; | 641 }; |
| 635 | 642 |
| 636 } // namespace autofill | 643 } // namespace autofill |
| 637 | 644 |
| 638 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 645 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
| OLD | NEW |