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