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

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

Issue 1392623002: [Autofill] Add metric for profile action on form submitted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 2 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 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 static void LogPasswordFormQueryVolume(PasswordFormQueryVolumeMetric metric); 576 static void LogPasswordFormQueryVolume(PasswordFormQueryVolumeMetric metric);
570 577
571 // Log how many autofilled fields in a given form were edited before 578 // Log how many autofilled fields in a given form were edited before
572 // submission. 579 // submission.
573 static void LogNumberOfEditedAutofilledFieldsAtSubmission( 580 static void LogNumberOfEditedAutofilledFieldsAtSubmission(
574 size_t num_edited_autofilled_fields); 581 size_t num_edited_autofilled_fields);
575 582
576 // This should be called each time a server response is parsed for a form. 583 // This should be called each time a server response is parsed for a form.
577 static void LogServerResponseHasDataForForm(bool has_data); 584 static void LogServerResponseHasDataForForm(bool has_data);
578 585
579 // This should be called at each form submission to indicate whether a new 586 // This should be called at each form submission to indicate what profile
580 // profile was created. 587 // action happened.
581 static void LogAutomaticProfileCreation(bool created); 588 static void LogProfileActionOnFormSubmitted(AutofillProfileAction action);
582 589
583 // Utility to autofill form events in the relevant histograms depending on 590 // Utility to autofill form events in the relevant histograms depending on
584 // the presence of server and/or local data. 591 // the presence of server and/or local data.
585 class FormEventLogger { 592 class FormEventLogger {
586 public: 593 public:
587 FormEventLogger(bool is_for_credit_card); 594 FormEventLogger(bool is_for_credit_card);
588 595
589 inline void set_is_server_data_available(bool is_server_data_available) { 596 inline void set_is_server_data_available(bool is_server_data_available) {
590 is_server_data_available_ = is_server_data_available; 597 is_server_data_available_ = is_server_data_available;
591 } 598 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 bool logged_suggestion_filled_was_masked_server_card_; 633 bool logged_suggestion_filled_was_masked_server_card_;
627 }; 634 };
628 635
629 private: 636 private:
630 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); 637 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics);
631 }; 638 };
632 639
633 } // namespace autofill 640 } // namespace autofill
634 641
635 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 642 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698