| 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 COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ |
| 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 FILLABLE_FORM_CONTAINS_TYPE_HINTS, | 44 FILLABLE_FORM_CONTAINS_TYPE_HINTS, |
| 45 NUM_DEVELOPER_ENGAGEMENT_METRICS, | 45 NUM_DEVELOPER_ENGAGEMENT_METRICS, |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 // The action the user took to dismiss a dialog. | 48 // The action the user took to dismiss a dialog. |
| 49 enum DialogDismissalAction { | 49 enum DialogDismissalAction { |
| 50 DIALOG_ACCEPTED = 0, // The user accepted, i.e. confirmed, the dialog. | 50 DIALOG_ACCEPTED = 0, // The user accepted, i.e. confirmed, the dialog. |
| 51 DIALOG_CANCELED, // The user canceled out of the dialog. | 51 DIALOG_CANCELED, // The user canceled out of the dialog. |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 // The initial state of user that's interacting with a freshly shown |
| 55 // requestAutocomplete or Autocheckout dialog. |
| 56 enum DialogInitialUserStateMetric { |
| 57 // Could not determine the user's state due to failure to communicate with |
| 58 // the Wallet server. |
| 59 DIALOG_USER_STATE_UNKNOWN = 0, |
| 60 // Not signed in, no verified Autofill profiles. |
| 61 DIALOG_USER_NOT_SIGNED_IN_NO_AUTOFILL, |
| 62 // Not signed in, has verified Autofill profiles. |
| 63 DIALOG_USER_NOT_SIGNED_IN_HAS_AUTOFILL, |
| 64 // Signed in, no Wallet items, no verified Autofill profiles. |
| 65 DIALOG_USER_SIGNED_IN_NO_WALLET_NO_AUTOFILL, |
| 66 // Signed in, no Wallet items, has verified Autofill profiles. |
| 67 DIALOG_USER_SIGNED_IN_NO_WALLET_HAS_AUTOFILL, |
| 68 // Signed in, has Wallet items, no verified Autofill profiles. |
| 69 DIALOG_USER_SIGNED_IN_HAS_WALLET_NO_AUTOFILL, |
| 70 // Signed in, has Wallet items, has verified Autofill profiles. |
| 71 DIALOG_USER_SIGNED_IN_HAS_WALLET_HAS_AUTOFILL, |
| 72 NUM_DIALOG_INITIAL_USER_STATE_METRICS |
| 73 }; |
| 74 |
| 54 // For measuring the frequency of security warnings or errors that can come | 75 // For measuring the frequency of security warnings or errors that can come |
| 55 // up as part of the requestAutocomplete flow. | 76 // up as part of the requestAutocomplete flow. |
| 56 enum DialogSecurityMetric { | 77 enum DialogSecurityMetric { |
| 57 // Baseline metric: The dialog was shown. | 78 // Baseline metric: The dialog was shown. |
| 58 SECURITY_METRIC_DIALOG_SHOWN = 0, | 79 SECURITY_METRIC_DIALOG_SHOWN = 0, |
| 59 // Credit card requested over non-secure protocol. | 80 // Credit card requested over non-secure protocol. |
| 60 SECURITY_METRIC_CREDIT_CARD_OVER_HTTP, | 81 SECURITY_METRIC_CREDIT_CARD_OVER_HTTP, |
| 61 // Autocomplete data requested from a frame hosted on an origin not matching | 82 // Autocomplete data requested from a frame hosted on an origin not matching |
| 62 // the main frame's origin. | 83 // the main frame's origin. |
| 63 SECURITY_METRIC_CROSS_ORIGIN_FRAME, | 84 SECURITY_METRIC_CROSS_ORIGIN_FRAME, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 AutofillFieldType field_type, | 210 AutofillFieldType field_type, |
| 190 const std::string& experiment_id) const; | 211 const std::string& experiment_id) const; |
| 191 | 212 |
| 192 virtual void LogQualityMetric(QualityMetric metric, | 213 virtual void LogQualityMetric(QualityMetric metric, |
| 193 const std::string& experiment_id) const; | 214 const std::string& experiment_id) const; |
| 194 | 215 |
| 195 virtual void LogServerQueryMetric(ServerQueryMetric metric) const; | 216 virtual void LogServerQueryMetric(ServerQueryMetric metric) const; |
| 196 | 217 |
| 197 virtual void LogUserHappinessMetric(UserHappinessMetric metric) const; | 218 virtual void LogUserHappinessMetric(UserHappinessMetric metric) const; |
| 198 | 219 |
| 220 // This should be called as soon as the user's signed-in status and Wallet |
| 221 // item count is known. Records that a user starting out in |user_state| is |
| 222 // interacting with a dialog of |dialog_type|. |
| 223 virtual void LogDialogInitialUserState( |
| 224 autofill::DialogType dialog_type, |
| 225 DialogInitialUserStateMetric user_type) const; |
| 226 |
| 199 // Logs |metric| to the security metrics histogram for |dialog_type|. | 227 // Logs |metric| to the security metrics histogram for |dialog_type|. |
| 200 virtual void LogDialogSecurityMetric(autofill::DialogType dialog_type, | 228 virtual void LogDialogSecurityMetric(autofill::DialogType dialog_type, |
| 201 DialogSecurityMetric metric) const; | 229 DialogSecurityMetric metric) const; |
| 202 | 230 |
| 203 // This should be called when the requestAutocomplete dialog, invoked by a | 231 // This should be called when the requestAutocomplete dialog, invoked by a |
| 204 // dialog of type |dialog_type|, is closed. |duration| should be the time | 232 // dialog of type |dialog_type|, is closed. |duration| should be the time |
| 205 // elapsed between the dialog being shown and it being closed. | 233 // elapsed between the dialog being shown and it being closed. |
| 206 // |dismissal_action| should indicate whether the user dismissed the dialog by | 234 // |dismissal_action| should indicate whether the user dismissed the dialog by |
| 207 // submitting the form data or by canceling. | 235 // submitting the form data or by canceling. |
| 208 virtual void LogDialogUiDuration( | 236 virtual void LogDialogUiDuration( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 284 |
| 257 // Logs the experiment id corresponding to an upload to the server. | 285 // Logs the experiment id corresponding to an upload to the server. |
| 258 virtual void LogServerExperimentIdForUpload( | 286 virtual void LogServerExperimentIdForUpload( |
| 259 const std::string& experiment_id) const; | 287 const std::string& experiment_id) const; |
| 260 | 288 |
| 261 private: | 289 private: |
| 262 DISALLOW_COPY_AND_ASSIGN(AutofillMetrics); | 290 DISALLOW_COPY_AND_ASSIGN(AutofillMetrics); |
| 263 }; | 291 }; |
| 264 | 292 |
| 265 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ | 293 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ |
| OLD | NEW |