| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ | |
| 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ | |
| 7 | |
| 8 #include <stddef.h> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "components/autofill/browser/autofill_manager_delegate.h" | |
| 13 #include "components/autofill/browser/field_types.h" | |
| 14 | |
| 15 namespace base { | |
| 16 class TimeDelta; | |
| 17 } | |
| 18 | |
| 19 namespace autofill { | |
| 20 | |
| 21 class AutofillMetrics { | |
| 22 public: | |
| 23 // The possible results of an Autocheckout flow. | |
| 24 enum AutocheckoutBuyFlowMetric { | |
| 25 // The user has initated Autocheckout. The baseline metric. | |
| 26 AUTOCHECKOUT_BUY_FLOW_STARTED, | |
| 27 // Autocheckout completed successfully. | |
| 28 AUTOCHECKOUT_BUY_FLOW_SUCCESS, | |
| 29 // Autocheckout failed due to missing server side data. | |
| 30 AUTOCHECKOUT_BUY_FLOW_MISSING_FIELDMAPPING, | |
| 31 // Autocheckout failed due to a missing proceed element. | |
| 32 AUTOCHECKOUT_BUY_FLOW_MISSING_ADVANCE_ELEMENT, | |
| 33 // Autocheckout failed for any number of other reasons, e.g, the proceed | |
| 34 // element click failed, the page numbers were not increasing, etc. | |
| 35 AUTOCHECKOUT_BUY_FLOW_CANNOT_PROCEED, | |
| 36 // Autocheckout failed due to a missing click element before form filling. | |
| 37 AUTOCHECKOUT_BUY_FLOW_MISSING_CLICK_ELEMENT_BEFORE_FORM_FILLING, | |
| 38 // Autocheckout failed due to a missing click element after form filling. | |
| 39 AUTOCHECKOUT_BUY_FLOW_MISSING_CLICK_ELEMENT_AFTER_FORM_FILLING, | |
| 40 NUM_AUTOCHECKOUT_BUY_FLOW_METRICS | |
| 41 }; | |
| 42 | |
| 43 // The success or failure of Autocheckout. | |
| 44 enum AutocheckoutCompletionStatus { | |
| 45 AUTOCHECKOUT_CANCELLED, // The user canceled Autocheckout while it was in | |
| 46 // progress. | |
| 47 AUTOCHECKOUT_FAILED, // The user canceled out of the dialog after | |
| 48 // an Autocheckout failure. | |
| 49 AUTOCHECKOUT_SUCCEEDED, // The dialog was closed after Autocheckout | |
| 50 // succeeded. | |
| 51 }; | |
| 52 | |
| 53 // The action a user took to dismiss a bubble. | |
| 54 enum BubbleMetric { | |
| 55 BUBBLE_CREATED = 0, // The bubble was created. | |
| 56 BUBBLE_ACCEPTED, // The user accepted, i.e. confirmed, the | |
| 57 // bubble. | |
| 58 BUBBLE_DISMISSED, // The user dismissed the bubble. | |
| 59 BUBBLE_IGNORED, // The user did not interact with the bubble. | |
| 60 BUBBLE_COULD_BE_DISPLAYED, // The bubble could be displayed. | |
| 61 NUM_BUBBLE_METRICS, | |
| 62 }; | |
| 63 | |
| 64 enum DeveloperEngagementMetric { | |
| 65 // Parsed a form that is potentially autofillable. | |
| 66 FILLABLE_FORM_PARSED = 0, | |
| 67 // Parsed a form that is potentially autofillable and contains at least one | |
| 68 // web developer-specified field type hint, a la | |
| 69 // http://is.gd/whatwg_autocomplete | |
| 70 FILLABLE_FORM_CONTAINS_TYPE_HINTS, | |
| 71 NUM_DEVELOPER_ENGAGEMENT_METRICS, | |
| 72 }; | |
| 73 | |
| 74 // The action the user took to dismiss a dialog. | |
| 75 enum DialogDismissalAction { | |
| 76 DIALOG_ACCEPTED = 0, // The user accepted, i.e. submitted, the dialog. | |
| 77 DIALOG_CANCELED, // The user canceled out of the dialog. | |
| 78 }; | |
| 79 | |
| 80 // The state of the Autofill dialog when it was dismissed. | |
| 81 enum DialogDismissalState { | |
| 82 // The user submitted with no data available to save. | |
| 83 DIALOG_ACCEPTED_EXISTING_DATA, | |
| 84 // The saved details to Online Wallet on submit. | |
| 85 DIALOG_ACCEPTED_SAVE_TO_WALLET, | |
| 86 // The saved details to the local Autofill database on submit. | |
| 87 DIALOG_ACCEPTED_SAVE_TO_AUTOFILL, | |
| 88 // The user submitted without saving any edited sections. | |
| 89 DIALOG_ACCEPTED_NO_SAVE, | |
| 90 // The user canceled with no edit UI showing. | |
| 91 DIALOG_CANCELED_NO_EDITS, | |
| 92 // The user canceled with edit UI showing, but no invalid fields. | |
| 93 DIALOG_CANCELED_NO_INVALID_FIELDS, | |
| 94 // The user canceled with at least one invalid field. | |
| 95 DIALOG_CANCELED_WITH_INVALID_FIELDS, | |
| 96 NUM_DIALOG_DISMISSAL_STATES | |
| 97 }; | |
| 98 | |
| 99 // The initial state of user that's interacting with a freshly shown Autofill | |
| 100 // dialog. | |
| 101 enum DialogInitialUserStateMetric { | |
| 102 // Could not determine the user's state due to failure to communicate with | |
| 103 // the Wallet server. | |
| 104 DIALOG_USER_STATE_UNKNOWN = 0, | |
| 105 // Not signed in, no verified Autofill profiles. | |
| 106 DIALOG_USER_NOT_SIGNED_IN_NO_AUTOFILL, | |
| 107 // Not signed in, has verified Autofill profiles. | |
| 108 DIALOG_USER_NOT_SIGNED_IN_HAS_AUTOFILL, | |
| 109 // Signed in, no Wallet items, no verified Autofill profiles. | |
| 110 DIALOG_USER_SIGNED_IN_NO_WALLET_NO_AUTOFILL, | |
| 111 // Signed in, no Wallet items, has verified Autofill profiles. | |
| 112 DIALOG_USER_SIGNED_IN_NO_WALLET_HAS_AUTOFILL, | |
| 113 // Signed in, has Wallet items, no verified Autofill profiles. | |
| 114 DIALOG_USER_SIGNED_IN_HAS_WALLET_NO_AUTOFILL, | |
| 115 // Signed in, has Wallet items, has verified Autofill profiles. | |
| 116 DIALOG_USER_SIGNED_IN_HAS_WALLET_HAS_AUTOFILL, | |
| 117 NUM_DIALOG_INITIAL_USER_STATE_METRICS | |
| 118 }; | |
| 119 | |
| 120 // Events related to the Autofill popup shown in a requestAutocomplete or | |
| 121 // Autocheckout dialog. | |
| 122 enum DialogPopupEvent { | |
| 123 // An Autofill popup was shown. | |
| 124 DIALOG_POPUP_SHOWN = 0, | |
| 125 // The user chose to fill the form with a suggestion from the popup. | |
| 126 DIALOG_POPUP_FORM_FILLED, | |
| 127 NUM_DIALOG_POPUP_EVENTS | |
| 128 }; | |
| 129 | |
| 130 // For measuring the frequency of security warnings or errors that can come | |
| 131 // up as part of the requestAutocomplete flow. | |
| 132 enum DialogSecurityMetric { | |
| 133 // Baseline metric: The dialog was shown. | |
| 134 SECURITY_METRIC_DIALOG_SHOWN = 0, | |
| 135 // Credit card requested over non-secure protocol. | |
| 136 SECURITY_METRIC_CREDIT_CARD_OVER_HTTP, | |
| 137 // Autocomplete data requested from a frame hosted on an origin not matching | |
| 138 // the main frame's origin. | |
| 139 SECURITY_METRIC_CROSS_ORIGIN_FRAME, | |
| 140 NUM_DIALOG_SECURITY_METRICS | |
| 141 }; | |
| 142 | |
| 143 // For measuring how users are interacting with the Autofill dialog UI. | |
| 144 enum DialogUiEvent { | |
| 145 // Baseline metric: The dialog was shown. | |
| 146 DIALOG_UI_SHOWN = 0, | |
| 147 | |
| 148 // Dialog dismissal actions: | |
| 149 DIALOG_UI_ACCEPTED, | |
| 150 DIALOG_UI_CANCELED, | |
| 151 | |
| 152 // Selections within the account switcher: | |
| 153 // Switched from a Wallet account to local Autofill data. | |
| 154 DIALOG_UI_ACCOUNT_CHOOSER_SWITCHED_TO_AUTOFILL, | |
| 155 // Switched from local Autofill data to a Wallet account. | |
| 156 DIALOG_UI_ACCOUNT_CHOOSER_SWITCHED_TO_WALLET, | |
| 157 // Switched from one Wallet account to another one. | |
| 158 DIALOG_UI_ACCOUNT_CHOOSER_SWITCHED_WALLET_ACCOUNT, | |
| 159 | |
| 160 // The sign-in UI was shown. | |
| 161 DIALOG_UI_SIGNIN_SHOWN, | |
| 162 | |
| 163 // Selecting a different item from a suggestion menu dropdown: | |
| 164 DIALOG_UI_EMAIL_SELECTED_SUGGESTION_CHANGED, | |
| 165 DIALOG_UI_BILLING_SELECTED_SUGGESTION_CHANGED, | |
| 166 DIALOG_UI_CC_BILLING_SELECTED_SUGGESTION_CHANGED, | |
| 167 DIALOG_UI_SHIPPING_SELECTED_SUGGESTION_CHANGED, | |
| 168 DIALOG_UI_CC_SELECTED_SUGGESTION_CHANGED, | |
| 169 | |
| 170 // Showing the editing UI for a section of the dialog: | |
| 171 DIALOG_UI_EMAIL_EDIT_UI_SHOWN, | |
| 172 DIALOG_UI_BILLING_EDIT_UI_SHOWN, | |
| 173 DIALOG_UI_CC_BILLING_EDIT_UI_SHOWN, | |
| 174 DIALOG_UI_SHIPPING_EDIT_UI_SHOWN, | |
| 175 DIALOG_UI_CC_EDIT_UI_SHOWN, | |
| 176 | |
| 177 // Adding a new item in a section of the dialog: | |
| 178 DIALOG_UI_EMAIL_ITEM_ADDED, | |
| 179 DIALOG_UI_BILLING_ITEM_ADDED, | |
| 180 DIALOG_UI_CC_BILLING_ITEM_ADDED, | |
| 181 DIALOG_UI_SHIPPING_ITEM_ADDED, | |
| 182 DIALOG_UI_CC_ITEM_ADDED, | |
| 183 | |
| 184 NUM_DIALOG_UI_EVENTS | |
| 185 }; | |
| 186 | |
| 187 enum InfoBarMetric { | |
| 188 INFOBAR_SHOWN = 0, // We showed an infobar, e.g. prompting to save credit | |
| 189 // card info. | |
| 190 INFOBAR_ACCEPTED, // The user explicitly accepted the infobar. | |
| 191 INFOBAR_DENIED, // The user explicitly denied the infobar. | |
| 192 INFOBAR_IGNORED, // The user completely ignored the infobar (logged on | |
| 193 // tab close). | |
| 194 NUM_INFO_BAR_METRICS, | |
| 195 }; | |
| 196 | |
| 197 // Metrics measuring how well we predict field types. Exactly three such | |
| 198 // metrics are logged for each fillable field in a submitted form: for | |
| 199 // the heuristic prediction, for the crowd-sourced prediction, and for the | |
| 200 // overall prediction. | |
| 201 enum FieldTypeQualityMetric { | |
| 202 TYPE_UNKNOWN = 0, // Offered no prediction. | |
| 203 TYPE_MATCH, // Predicted correctly. | |
| 204 TYPE_MISMATCH, // Predicted incorrectly. | |
| 205 NUM_FIELD_TYPE_QUALITY_METRICS, | |
| 206 }; | |
| 207 | |
| 208 enum QualityMetric { | |
| 209 // Logged for each potentially fillable field in a submitted form. | |
| 210 FIELD_SUBMITTED = 0, | |
| 211 | |
| 212 // A simple successs metric, logged for each field that returns true for | |
| 213 // |is_autofilled()|. | |
| 214 FIELD_AUTOFILLED, | |
| 215 | |
| 216 // A simple failure metric, logged for each field that returns false for | |
| 217 // |is_autofilled()| but has a value that is present in the personal data | |
| 218 // manager. | |
| 219 FIELD_NOT_AUTOFILLED, | |
| 220 | |
| 221 // The below are only logged when |FIELD_AUTOFILL_FAILED| is also logged. | |
| 222 NOT_AUTOFILLED_HEURISTIC_TYPE_UNKNOWN, | |
| 223 NOT_AUTOFILLED_HEURISTIC_TYPE_MATCH, | |
| 224 NOT_AUTOFILLED_HEURISTIC_TYPE_MISMATCH, | |
| 225 NOT_AUTOFILLED_SERVER_TYPE_UNKNOWN, | |
| 226 NOT_AUTOFILLED_SERVER_TYPE_MATCH, | |
| 227 NOT_AUTOFILLED_SERVER_TYPE_MISMATCH, | |
| 228 NUM_QUALITY_METRICS, | |
| 229 }; | |
| 230 | |
| 231 // Each of these is logged at most once per query to the server, which in turn | |
| 232 // occurs at most once per page load. | |
| 233 enum ServerQueryMetric { | |
| 234 QUERY_SENT = 0, // Sent a query to the server. | |
| 235 QUERY_RESPONSE_RECEIVED, // Received a response. | |
| 236 QUERY_RESPONSE_PARSED, // Successfully parsed the server response. | |
| 237 | |
| 238 // The response was parseable, but provided no improvements relative to our | |
| 239 // heuristics. | |
| 240 QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, | |
| 241 | |
| 242 // Our heuristics detected at least one auto-fillable field, and the server | |
| 243 // response overrode the type of at least one field. | |
| 244 QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, | |
| 245 | |
| 246 // Our heuristics did not detect any auto-fillable fields, but the server | |
| 247 // response did detect at least one. | |
| 248 QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, | |
| 249 NUM_SERVER_QUERY_METRICS, | |
| 250 }; | |
| 251 | |
| 252 // Each of these metrics is logged only for potentially autofillable forms, | |
| 253 // i.e. forms with at least three fields, etc. | |
| 254 // These are used to derive certain "user happiness" metrics. For example, we | |
| 255 // can compute the ratio (USER_DID_EDIT_AUTOFILLED_FIELD / USER_DID_AUTOFILL) | |
| 256 // to see how often users have to correct autofilled data. | |
| 257 enum UserHappinessMetric { | |
| 258 // Loaded a page containing forms. | |
| 259 FORMS_LOADED, | |
| 260 // Submitted a fillable form -- i.e. one with at least three field values | |
| 261 // that match the user's stored Autofill data -- and all matching fields | |
| 262 // were autofilled. | |
| 263 SUBMITTED_FILLABLE_FORM_AUTOFILLED_ALL, | |
| 264 // Submitted a fillable form and some (but not all) matching fields were | |
| 265 // autofilled. | |
| 266 SUBMITTED_FILLABLE_FORM_AUTOFILLED_SOME, | |
| 267 // Submitted a fillable form and no fields were autofilled. | |
| 268 SUBMITTED_FILLABLE_FORM_AUTOFILLED_NONE, | |
| 269 // Submitted a non-fillable form. | |
| 270 SUBMITTED_NON_FILLABLE_FORM, | |
| 271 | |
| 272 // User manually filled one of the form fields. | |
| 273 USER_DID_TYPE, | |
| 274 // We showed a popup containing Autofill suggestions. | |
| 275 SUGGESTIONS_SHOWN, | |
| 276 // Same as above, but only logged once per page load. | |
| 277 SUGGESTIONS_SHOWN_ONCE, | |
| 278 // User autofilled at least part of the form. | |
| 279 USER_DID_AUTOFILL, | |
| 280 // Same as above, but only logged once per page load. | |
| 281 USER_DID_AUTOFILL_ONCE, | |
| 282 // User edited a previously autofilled field. | |
| 283 USER_DID_EDIT_AUTOFILLED_FIELD, | |
| 284 // Same as above, but only logged once per page load. | |
| 285 USER_DID_EDIT_AUTOFILLED_FIELD_ONCE, | |
| 286 NUM_USER_HAPPINESS_METRICS, | |
| 287 }; | |
| 288 | |
| 289 // For measuring the network request time of various Wallet API calls. See | |
| 290 // WalletClient::RequestType. | |
| 291 enum WalletApiCallMetric { | |
| 292 UNKNOWN_API_CALL, // Catch all. Should never be used. | |
| 293 ACCEPT_LEGAL_DOCUMENTS, | |
| 294 AUTHENTICATE_INSTRUMENT, | |
| 295 GET_FULL_WALLET, | |
| 296 GET_WALLET_ITEMS, | |
| 297 SAVE_ADDRESS, | |
| 298 SAVE_INSTRUMENT, | |
| 299 SAVE_INSTRUMENT_AND_ADDRESS, | |
| 300 SEND_STATUS, | |
| 301 UPDATE_ADDRESS, | |
| 302 UPDATE_INSTRUMENT, | |
| 303 }; | |
| 304 | |
| 305 // For measuring the frequency of errors while communicating with the Wallet | |
| 306 // server. | |
| 307 enum WalletErrorMetric { | |
| 308 // Baseline metric: Issued a request to the Wallet server. | |
| 309 WALLET_ERROR_BASELINE_ISSUED_REQUEST = 0, | |
| 310 // A fatal error occured while communicating with the Wallet server. This | |
| 311 // value has been deprecated. | |
| 312 WALLET_FATAL_ERROR_DEPRECATED, | |
| 313 // Received a malformed response from the Wallet server. | |
| 314 WALLET_MALFORMED_RESPONSE, | |
| 315 // A network error occured while communicating with the Wallet server. | |
| 316 WALLET_NETWORK_ERROR, | |
| 317 // The request was malformed. | |
| 318 WALLET_BAD_REQUEST, | |
| 319 // Risk deny, unsupported country, or account closed. | |
| 320 WALLET_BUYER_ACCOUNT_ERROR, | |
| 321 // Unknown server side error. | |
| 322 WALLET_INTERNAL_ERROR, | |
| 323 // API call had missing or invalid parameters. | |
| 324 WALLET_INVALID_PARAMS, | |
| 325 // Online Wallet is down. | |
| 326 WALLET_SERVICE_UNAVAILABLE, | |
| 327 // User needs make a cheaper transaction or not use Online Wallet. This | |
| 328 // value has been deprecated. | |
| 329 WALLET_SPENDING_LIMIT_EXCEEDED_DEPRECATED, | |
| 330 // The server API version of the request is no longer supported. | |
| 331 WALLET_UNSUPPORTED_API_VERSION, | |
| 332 // Catch all error type. | |
| 333 WALLET_UNKNOWN_ERROR, | |
| 334 NUM_WALLET_ERROR_METRICS | |
| 335 }; | |
| 336 | |
| 337 // For measuring the frequency of "required actions" returned by the Wallet | |
| 338 // server. This is similar to the autofill::wallet::RequiredAction enum; | |
| 339 // but unlike that enum, the values in this one must remain constant over | |
| 340 // time, so that the metrics can be consistently interpreted on the | |
| 341 // server-side. | |
| 342 enum WalletRequiredActionMetric { | |
| 343 // Baseline metric: Issued a request to the Wallet server. | |
| 344 WALLET_REQUIRED_ACTION_BASELINE_ISSUED_REQUEST = 0, | |
| 345 // Values from the autofill::wallet::RequiredAction enum: | |
| 346 UNKNOWN_REQUIRED_ACTION, // Catch all type. | |
| 347 GAIA_AUTH, | |
| 348 PASSIVE_GAIA_AUTH, | |
| 349 SETUP_WALLET, | |
| 350 ACCEPT_TOS, | |
| 351 UPDATE_EXPIRATION_DATE, | |
| 352 UPGRADE_MIN_ADDRESS, | |
| 353 CHOOSE_ANOTHER_INSTRUMENT_OR_ADDRESS, | |
| 354 VERIFY_CVV, | |
| 355 INVALID_FORM_FIELD, | |
| 356 REQUIRE_PHONE_NUMBER, | |
| 357 NUM_WALLET_REQUIRED_ACTIONS | |
| 358 }; | |
| 359 | |
| 360 // The success or failure of downloading Autocheckout whitelist file. | |
| 361 enum AutocheckoutWhitelistDownloadStatus { | |
| 362 AUTOCHECKOUT_WHITELIST_DOWNLOAD_FAILED, | |
| 363 AUTOCHECKOUT_WHITELIST_DOWNLOAD_SUCCEEDED, | |
| 364 }; | |
| 365 | |
| 366 AutofillMetrics(); | |
| 367 virtual ~AutofillMetrics(); | |
| 368 | |
| 369 // Logs how the user interacted with the Autocheckout bubble. | |
| 370 virtual void LogAutocheckoutBubbleMetric(BubbleMetric metric) const; | |
| 371 | |
| 372 // Logs the result of an Autocheckout buy flow. | |
| 373 virtual void LogAutocheckoutBuyFlowMetric( | |
| 374 AutocheckoutBuyFlowMetric metric) const; | |
| 375 | |
| 376 virtual void LogCreditCardInfoBarMetric(InfoBarMetric metric) const; | |
| 377 | |
| 378 virtual void LogDeveloperEngagementMetric( | |
| 379 DeveloperEngagementMetric metric) const; | |
| 380 | |
| 381 virtual void LogHeuristicTypePrediction( | |
| 382 FieldTypeQualityMetric metric, | |
| 383 AutofillFieldType field_type, | |
| 384 const std::string& experiment_id) const; | |
| 385 virtual void LogOverallTypePrediction( | |
| 386 FieldTypeQualityMetric metric, | |
| 387 AutofillFieldType field_type, | |
| 388 const std::string& experiment_id) const; | |
| 389 virtual void LogServerTypePrediction(FieldTypeQualityMetric metric, | |
| 390 AutofillFieldType field_type, | |
| 391 const std::string& experiment_id) const; | |
| 392 | |
| 393 virtual void LogQualityMetric(QualityMetric metric, | |
| 394 const std::string& experiment_id) const; | |
| 395 | |
| 396 virtual void LogServerQueryMetric(ServerQueryMetric metric) const; | |
| 397 | |
| 398 virtual void LogUserHappinessMetric(UserHappinessMetric metric) const; | |
| 399 | |
| 400 // Logs |state| to the dismissal states histogram for |dialog_type|. | |
| 401 virtual void LogDialogDismissalState(autofill::DialogType dialog_type, | |
| 402 DialogDismissalState state) const; | |
| 403 | |
| 404 // This should be called as soon as the user's signed-in status and Wallet | |
| 405 // item count is known. Records that a user starting out in |user_state| is | |
| 406 // interacting with a dialog of |dialog_type|. | |
| 407 virtual void LogDialogInitialUserState( | |
| 408 autofill::DialogType dialog_type, | |
| 409 DialogInitialUserStateMetric user_type) const; | |
| 410 | |
| 411 // Logs the time elapsed between the dialog being shown for |dialog_type| and | |
| 412 // when it is ready for user interaction. | |
| 413 virtual void LogDialogLatencyToShow(autofill::DialogType dialog_type, | |
| 414 const base::TimeDelta& duration) const; | |
| 415 | |
| 416 // Logs |event| to the popup events histogram for |dialog_type|. | |
| 417 virtual void LogDialogPopupEvent(autofill::DialogType dialog_type, | |
| 418 DialogPopupEvent event) const; | |
| 419 | |
| 420 // Logs |metric| to the security metrics histogram for |dialog_type|. | |
| 421 virtual void LogDialogSecurityMetric(autofill::DialogType dialog_type, | |
| 422 DialogSecurityMetric metric) const; | |
| 423 | |
| 424 // This should be called when the Autofill dialog, invoked by a dialog of type | |
| 425 // |dialog_type|, is closed. |duration| should be the time elapsed between | |
| 426 // the dialog being shown and it being closed. |dismissal_action| should | |
| 427 // indicate whether the user dismissed the dialog by submitting the form data | |
| 428 // or by canceling. | |
| 429 virtual void LogDialogUiDuration( | |
| 430 const base::TimeDelta& duration, | |
| 431 autofill::DialogType dialog_type, | |
| 432 DialogDismissalAction dismissal_action) const; | |
| 433 | |
| 434 // Logs |event| to the UI events histogram for |dialog_type|. | |
| 435 virtual void LogDialogUiEvent(autofill::DialogType dialog_type, | |
| 436 DialogUiEvent event) const; | |
| 437 | |
| 438 // Logs |metric| to the Wallet errors histogram for |dialog_type|. | |
| 439 virtual void LogWalletErrorMetric(autofill::DialogType dialog_type, | |
| 440 WalletErrorMetric metric) const; | |
| 441 | |
| 442 // Logs the network request time of Wallet API calls. | |
| 443 virtual void LogWalletApiCallDuration( | |
| 444 WalletApiCallMetric metric, | |
| 445 const base::TimeDelta& duration) const; | |
| 446 | |
| 447 // Logs |required_action| to the required actions histogram for |dialog_type|. | |
| 448 virtual void LogWalletRequiredActionMetric( | |
| 449 autofill::DialogType dialog_type, | |
| 450 WalletRequiredActionMetric required_action) const; | |
| 451 | |
| 452 virtual void LogAutocheckoutDuration( | |
| 453 const base::TimeDelta& duration, | |
| 454 AutocheckoutCompletionStatus status) const; | |
| 455 | |
| 456 // Logs the time taken to download Autocheckout whitelist file. | |
| 457 virtual void LogAutocheckoutWhitelistDownloadDuration( | |
| 458 const base::TimeDelta& duration, | |
| 459 AutocheckoutWhitelistDownloadStatus status) const; | |
| 460 | |
| 461 // This should be called when a form that has been Autofilled is submitted. | |
| 462 // |duration| should be the time elapsed between form load and submission. | |
| 463 virtual void LogFormFillDurationFromLoadWithAutofill( | |
| 464 const base::TimeDelta& duration) const; | |
| 465 | |
| 466 // This should be called when a fillable form that has not been Autofilled is | |
| 467 // submitted. |duration| should be the time elapsed between form load and | |
| 468 // submission. | |
| 469 virtual void LogFormFillDurationFromLoadWithoutAutofill( | |
| 470 const base::TimeDelta& duration) const; | |
| 471 | |
| 472 // This should be called when a form that has been Autofilled is submitted. | |
| 473 // |duration| should be the time elapsed between the initial form interaction | |
| 474 // and submission. | |
| 475 virtual void LogFormFillDurationFromInteractionWithAutofill( | |
| 476 const base::TimeDelta& duration) const; | |
| 477 | |
| 478 // This should be called when a fillable form that has not been Autofilled is | |
| 479 // submitted. |duration| should be the time elapsed between the initial form | |
| 480 // interaction and submission. | |
| 481 virtual void LogFormFillDurationFromInteractionWithoutAutofill( | |
| 482 const base::TimeDelta& duration) const; | |
| 483 | |
| 484 // This should be called each time a page containing forms is loaded. | |
| 485 virtual void LogIsAutofillEnabledAtPageLoad(bool enabled) const; | |
| 486 | |
| 487 // This should be called each time a new profile is launched. | |
| 488 virtual void LogIsAutofillEnabledAtStartup(bool enabled) const; | |
| 489 | |
| 490 // This should be called each time a new profile is launched. | |
| 491 virtual void LogStoredProfileCount(size_t num_profiles) const; | |
| 492 | |
| 493 // Log the number of Autofill suggestions presented to the user when filling a | |
| 494 // form. | |
| 495 virtual void LogAddressSuggestionsCount(size_t num_suggestions) const; | |
| 496 | |
| 497 // Logs the experiment id corresponding to a server query response. | |
| 498 virtual void LogServerExperimentIdForQuery( | |
| 499 const std::string& experiment_id) const; | |
| 500 | |
| 501 // Logs the experiment id corresponding to an upload to the server. | |
| 502 virtual void LogServerExperimentIdForUpload( | |
| 503 const std::string& experiment_id) const; | |
| 504 | |
| 505 private: | |
| 506 DISALLOW_COPY_AND_ASSIGN(AutofillMetrics); | |
| 507 }; | |
| 508 | |
| 509 } // namespace autofill | |
| 510 | |
| 511 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_METRICS_H_ | |
| OLD | NEW |