| OLD | NEW |
| 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 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, | 277 FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, |
| 278 FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, | 278 FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, |
| 279 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, | 279 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, |
| 280 // A masked server card suggestion was selected to fill the form. | 280 // A masked server card suggestion was selected to fill the form. |
| 281 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED, | 281 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED, |
| 282 // Same as above but only triggered once per page load. | 282 // Same as above but only triggered once per page load. |
| 283 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED_ONCE, | 283 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED_ONCE, |
| 284 NUM_FORM_EVENTS, | 284 NUM_FORM_EVENTS, |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 // Events related to the Unmask Credit Card Prompt. |
| 288 enum UnmaskPromptEvent { |
| 289 // The prompt was shown. |
| 290 UNMASK_PROMPT_SHOWN = 0, |
| 291 // The prompt was closed without attempting to unmask the card. |
| 292 UNMASK_PROMPT_CLOSED_NO_ATTEMPTS, |
| 293 // The prompt was closed without unmasking the card, but with at least |
| 294 // one attempt. The last failure was retriable. |
| 295 UNMASK_PROMPT_CLOSED_FAILED_TO_UNMASK_RETRIABLE_FAILURE, |
| 296 // The prompt was closed without unmasking the card, but with at least |
| 297 // one attempt. The last failure was non retriable. |
| 298 UNMASK_PROMPT_CLOSED_FAILED_TO_UNMASK_NON_RETRIABLE_FAILURE, |
| 299 // Successfully unmasked the card in the first attempt. |
| 300 UNMASK_PROMPT_UNMASKED_CARD_FIRST_ATTEMPT, |
| 301 // Successfully unmasked the card after retriable failures. |
| 302 UNMASK_PROMPT_UNMASKED_CARD_AFTER_FAILED_ATTEMPTS, |
| 303 // Saved the card locally (masked card was upgraded to a full card). |
| 304 UNMASK_PROMPT_SAVED_CARD_LOCALLY, |
| 305 // User chose to opt in (checked the checkbox when it was empty). |
| 306 // Only logged if there was an attempt to unmask. |
| 307 UNMASK_PROMPT_LOCAL_SAVE_DID_OPT_IN, |
| 308 // User did not opt in when he had the chance (left the checkbox unchecked). |
| 309 // Only logged if there was an attempt to unmask. |
| 310 UNMASK_PROMPT_LOCAL_SAVE_DID_NOT_OPT_IN, |
| 311 // User chose to opt out (unchecked the checkbox when it was check). |
| 312 // Only logged if there was an attempt to unmask. |
| 313 UNMASK_PROMPT_LOCAL_SAVE_DID_OPT_OUT, |
| 314 // User did not opt out when he had a chance (left the checkbox checked). |
| 315 // Only logged if there was an attempt to unmask. |
| 316 UNMASK_PROMPT_LOCAL_SAVE_DID_NOT_OPT_OUT, |
| 317 NUM_UNMASK_PROMPT_EVENTS, |
| 318 }; |
| 319 |
| 287 // For measuring the network request time of various Wallet API calls. See | 320 // For measuring the network request time of various Wallet API calls. See |
| 288 // WalletClient::RequestType. | 321 // WalletClient::RequestType. |
| 289 enum WalletApiCallMetric { | 322 enum WalletApiCallMetric { |
| 290 UNKNOWN_API_CALL, // Catch all. Should never be used. | 323 UNKNOWN_API_CALL, // Catch all. Should never be used. |
| 291 ACCEPT_LEGAL_DOCUMENTS, | 324 ACCEPT_LEGAL_DOCUMENTS, |
| 292 AUTHENTICATE_INSTRUMENT, | 325 AUTHENTICATE_INSTRUMENT, |
| 293 GET_FULL_WALLET, | 326 GET_FULL_WALLET, |
| 294 GET_WALLET_ITEMS, | 327 GET_WALLET_ITEMS, |
| 295 SAVE_TO_WALLET, | 328 SAVE_TO_WALLET, |
| 296 NUM_WALLET_API_CALLS | 329 NUM_WALLET_API_CALLS |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 // This should be called when the Autofill dialog is closed. |duration| | 436 // This should be called when the Autofill dialog is closed. |duration| |
| 404 // should be the time elapsed between the dialog being shown and it being | 437 // should be the time elapsed between the dialog being shown and it being |
| 405 // closed. |dismissal_action| should indicate whether the user dismissed | 438 // closed. |dismissal_action| should indicate whether the user dismissed |
| 406 // the dialog by submitting the form data or by canceling. | 439 // the dialog by submitting the form data or by canceling. |
| 407 static void LogDialogUiDuration(const base::TimeDelta& duration, | 440 static void LogDialogUiDuration(const base::TimeDelta& duration, |
| 408 DialogDismissalAction dismissal_action); | 441 DialogDismissalAction dismissal_action); |
| 409 | 442 |
| 410 // Logs |event| to the UI events histogram. | 443 // Logs |event| to the UI events histogram. |
| 411 static void LogDialogUiEvent(DialogUiEvent event); | 444 static void LogDialogUiEvent(DialogUiEvent event); |
| 412 | 445 |
| 446 // Logs |event| to the unmask prompt events histogram. |
| 447 static void LogUnmaskPromptEvent(UnmaskPromptEvent event); |
| 448 |
| 413 // Logs |metric| to the Wallet errors histogram. | 449 // Logs |metric| to the Wallet errors histogram. |
| 414 static void LogWalletErrorMetric(WalletErrorMetric metric); | 450 static void LogWalletErrorMetric(WalletErrorMetric metric); |
| 415 | 451 |
| 416 // Logs the network request time of Wallet API calls. | 452 // Logs the network request time of Wallet API calls. |
| 417 static void LogWalletApiCallDuration(WalletApiCallMetric metric, | 453 static void LogWalletApiCallDuration(WalletApiCallMetric metric, |
| 418 const base::TimeDelta& duration); | 454 const base::TimeDelta& duration); |
| 419 | 455 |
| 420 // Logs that the Wallet API call corresponding to |metric| was malformed. | 456 // Logs that the Wallet API call corresponding to |metric| was malformed. |
| 421 static void LogWalletMalformedResponseMetric(WalletApiCallMetric metric); | 457 static void LogWalletMalformedResponseMetric(WalletApiCallMetric metric); |
| 422 | 458 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 bool logged_suggestion_filled_was_masked_server_card_; | 547 bool logged_suggestion_filled_was_masked_server_card_; |
| 512 }; | 548 }; |
| 513 | 549 |
| 514 private: | 550 private: |
| 515 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 551 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
| 516 }; | 552 }; |
| 517 | 553 |
| 518 } // namespace autofill | 554 } // namespace autofill |
| 519 | 555 |
| 520 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 556 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
| OLD | NEW |