| 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  | 
 |  320   // Possible results of the GetRealPan call. | 
 |  321   enum GetRealPanResult { | 
 |  322     // Request succeeded. | 
 |  323     GET_REAL_PAN_RESULT_SUCCESS = 0, | 
 |  324     // Request failed; try again. | 
 |  325     GET_REAL_PAN_RESULT_TRY_AGAIN_FAILURE, | 
 |  326     // Request failed; don't try again. | 
 |  327     GET_REAL_PAN_RESULT_PERMANENT_FAILURE, | 
 |  328     // Unable to connect to Wallet servers. | 
 |  329     GET_REAL_PAN_RESULT_NETWORK_ERROR, | 
 |  330     NUM_GET_REAL_PAN_RESULTS, | 
 |  331   }; | 
 |  332  | 
|  287   // For measuring the network request time of various Wallet API calls. See |  333   // For measuring the network request time of various Wallet API calls. See | 
|  288   // WalletClient::RequestType. |  334   // WalletClient::RequestType. | 
|  289   enum WalletApiCallMetric { |  335   enum WalletApiCallMetric { | 
|  290     UNKNOWN_API_CALL,  // Catch all. Should never be used. |  336     UNKNOWN_API_CALL,  // Catch all. Should never be used. | 
|  291     ACCEPT_LEGAL_DOCUMENTS, |  337     ACCEPT_LEGAL_DOCUMENTS, | 
|  292     AUTHENTICATE_INSTRUMENT, |  338     AUTHENTICATE_INSTRUMENT, | 
|  293     GET_FULL_WALLET, |  339     GET_FULL_WALLET, | 
|  294     GET_WALLET_ITEMS, |  340     GET_WALLET_ITEMS, | 
|  295     SAVE_TO_WALLET, |  341     SAVE_TO_WALLET, | 
|  296     NUM_WALLET_API_CALLS |  342     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| |  449   // 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 |  450   // should be the time elapsed between the dialog being shown and it being | 
|  405   // closed.  |dismissal_action| should indicate whether the user dismissed |  451   // closed.  |dismissal_action| should indicate whether the user dismissed | 
|  406   // the dialog by submitting the form data or by canceling. |  452   // the dialog by submitting the form data or by canceling. | 
|  407   static void LogDialogUiDuration(const base::TimeDelta& duration, |  453   static void LogDialogUiDuration(const base::TimeDelta& duration, | 
|  408                                   DialogDismissalAction dismissal_action); |  454                                   DialogDismissalAction dismissal_action); | 
|  409  |  455  | 
|  410   // Logs |event| to the UI events histogram. |  456   // Logs |event| to the UI events histogram. | 
|  411   static void LogDialogUiEvent(DialogUiEvent event); |  457   static void LogDialogUiEvent(DialogUiEvent event); | 
|  412  |  458  | 
 |  459   // Logs |event| to the unmask prompt events histogram. | 
 |  460   static void LogUnmaskPromptEvent(UnmaskPromptEvent event); | 
 |  461  | 
 |  462   // Logs |result| to the get real pan result histogram. | 
 |  463   static void LogRealPanResult(AutofillClient::GetRealPanResult result); | 
 |  464  | 
|  413   // Logs |metric| to the Wallet errors histogram. |  465   // Logs |metric| to the Wallet errors histogram. | 
|  414   static void LogWalletErrorMetric(WalletErrorMetric metric); |  466   static void LogWalletErrorMetric(WalletErrorMetric metric); | 
|  415  |  467  | 
|  416   // Logs the network request time of Wallet API calls. |  468   // Logs the network request time of Wallet API calls. | 
|  417   static void LogWalletApiCallDuration(WalletApiCallMetric metric, |  469   static void LogWalletApiCallDuration(WalletApiCallMetric metric, | 
|  418                                        const base::TimeDelta& duration); |  470                                        const base::TimeDelta& duration); | 
|  419  |  471  | 
|  420   // Logs that the Wallet API call corresponding to |metric| was malformed. |  472   // Logs that the Wallet API call corresponding to |metric| was malformed. | 
|  421   static void LogWalletMalformedResponseMetric(WalletApiCallMetric metric); |  473   static void LogWalletMalformedResponseMetric(WalletApiCallMetric metric); | 
|  422  |  474  | 
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  511     bool logged_suggestion_filled_was_masked_server_card_; |  563     bool logged_suggestion_filled_was_masked_server_card_; | 
|  512   }; |  564   }; | 
|  513  |  565  | 
|  514  private: |  566  private: | 
|  515   DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |  567   DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 
|  516 }; |  568 }; | 
|  517  |  569  | 
|  518 }  // namespace autofill |  570 }  // namespace autofill | 
|  519  |  571  | 
|  520 #endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |  572 #endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 
| OLD | NEW |