OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ | 6 #define CHROME_BROWSER_AUTOFILL_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 "chrome/browser/autofill/field_types.h" | 12 #include "chrome/browser/autofill/field_types.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class TimeDelta; | 15 class TimeDelta; |
16 } | 16 } |
17 | 17 |
18 class AutofillMetrics { | 18 class AutofillMetrics { |
19 public: | 19 public: |
20 enum DeveloperEngagementMetric { | 20 enum DeveloperEngagementMetric { |
21 // Parsed a form that is potentially autofillable. | 21 // Parsed a form that is potentially autofillable. |
22 FILLABLE_FORM_PARSED = 0, | 22 FILLABLE_FORM_PARSED = 0, |
23 // Parsed a form that is potentially autofillable and contains at least one | 23 // Parsed a form that is potentially autofillable and contains at least one |
24 // web developer-specified field type hint, a la | 24 // web developer-specified field type hint, a la |
25 // http://is.gd/whatwg_autocomplete | 25 // http://is.gd/whatwg_autocomplete |
26 FILLABLE_FORM_CONTAINS_TYPE_HINTS, | 26 FILLABLE_FORM_CONTAINS_TYPE_HINTS, |
27 NUM_DEVELOPER_ENGAGEMENT_METRICS | 27 NUM_DEVELOPER_ENGAGEMENT_METRICS |
28 }; | 28 }; |
29 | 29 |
30 // The action the user took to dismiss a dialog. | |
31 enum DialogDismissalAction { | |
32 DIALOG_ACCEPTED = 0, // The user accepted, i.e. confirmed, the dialog. | |
33 DIALOG_CANCELED // The user canceled out of the dialog. | |
Dan Beam
2013/01/31 19:47:16
super optional nit: trailing ,
Ilya Sherman
2013/02/01 09:55:17
Left it out to be consistent with the rest of the
Dan Beam
2013/02/01 17:18:08
Why does the rest of the file hate , :P?
| |
34 }; | |
35 | |
30 enum InfoBarMetric { | 36 enum InfoBarMetric { |
31 INFOBAR_SHOWN = 0, // We showed an infobar, e.g. prompting to save credit | 37 INFOBAR_SHOWN = 0, // We showed an infobar, e.g. prompting to save credit |
32 // card info. | 38 // card info. |
33 INFOBAR_ACCEPTED, // The user explicitly accepted the infobar. | 39 INFOBAR_ACCEPTED, // The user explicitly accepted the infobar. |
34 INFOBAR_DENIED, // The user explicitly denied the infobar. | 40 INFOBAR_DENIED, // The user explicitly denied the infobar. |
35 INFOBAR_IGNORED, // The user completely ignored the infobar (logged on | 41 INFOBAR_IGNORED, // The user completely ignored the infobar (logged on |
36 // tab close). | 42 // tab close). |
37 NUM_INFO_BAR_METRICS | 43 NUM_INFO_BAR_METRICS |
38 }; | 44 }; |
39 | 45 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 | 157 |
152 virtual void LogQualityMetric(QualityMetric metric, | 158 virtual void LogQualityMetric(QualityMetric metric, |
153 const std::string& experiment_id) const; | 159 const std::string& experiment_id) const; |
154 | 160 |
155 virtual void LogServerQueryMetric(ServerQueryMetric metric) const; | 161 virtual void LogServerQueryMetric(ServerQueryMetric metric) const; |
156 | 162 |
157 virtual void LogUserHappinessMetric(UserHappinessMetric metric) const; | 163 virtual void LogUserHappinessMetric(UserHappinessMetric metric) const; |
158 | 164 |
159 virtual void LogAutocheckoutInfoBarMetric(InfoBarMetric metric) const; | 165 virtual void LogAutocheckoutInfoBarMetric(InfoBarMetric metric) const; |
160 | 166 |
167 // This should be called when the requestAutocomplete dialog is closed. | |
168 // |duration| should be the time elapsed between the dialog being shown and it | |
169 // being closed. |dismissal_action| should indicate whether the user | |
170 // dismissed the dialog by submitting the form data or by cancelling. | |
171 virtual void LogRequestAutocompleteUiDuration( | |
172 const base::TimeDelta& duration, | |
173 DialogDismissalAction dismissal_action) const; | |
174 | |
161 // This should be called when a form that has been Autofilled is submitted. | 175 // This should be called when a form that has been Autofilled is submitted. |
162 // |duration| should be the time elapsed between form load and submission. | 176 // |duration| should be the time elapsed between form load and submission. |
163 virtual void LogFormFillDurationFromLoadWithAutofill( | 177 virtual void LogFormFillDurationFromLoadWithAutofill( |
164 const base::TimeDelta& duration) const; | 178 const base::TimeDelta& duration) const; |
165 | 179 |
166 // This should be called when a fillable form that has not been Autofilled is | 180 // This should be called when a fillable form that has not been Autofilled is |
167 // submitted. |duration| should be the time elapsed between form load and | 181 // submitted. |duration| should be the time elapsed between form load and |
168 // submission. | 182 // submission. |
169 virtual void LogFormFillDurationFromLoadWithoutAutofill( | 183 virtual void LogFormFillDurationFromLoadWithoutAutofill( |
170 const base::TimeDelta& duration) const; | 184 const base::TimeDelta& duration) const; |
(...skipping 29 matching lines...) Expand all Loading... | |
200 | 214 |
201 // Logs the experiment id corresponding to an upload to the server. | 215 // Logs the experiment id corresponding to an upload to the server. |
202 virtual void LogServerExperimentIdForUpload( | 216 virtual void LogServerExperimentIdForUpload( |
203 const std::string& experiment_id) const; | 217 const std::string& experiment_id) const; |
204 | 218 |
205 private: | 219 private: |
206 DISALLOW_COPY_AND_ASSIGN(AutofillMetrics); | 220 DISALLOW_COPY_AND_ASSIGN(AutofillMetrics); |
207 }; | 221 }; |
208 | 222 |
209 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ | 223 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ |
OLD | NEW |