| 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 #include "components/autofill/core/browser/autofill_metrics.h" |    5 #include "components/autofill/core/browser/autofill_metrics.h" | 
|    6  |    6  | 
|    7 #include "base/logging.h" |    7 #include "base/logging.h" | 
|    8 #include "base/metrics/histogram.h" |    8 #include "base/metrics/histogram.h" | 
|    9 #include "base/metrics/sparse_histogram.h" |    9 #include "base/metrics/sparse_histogram.h" | 
|   10 #include "base/time/time.h" |   10 #include "base/time/time.h" | 
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  334                            duration); |  334                            duration); | 
|  335 } |  335 } | 
|  336  |  336  | 
|  337 // static |  337 // static | 
|  338 void AutofillMetrics::LogDialogUiEvent(DialogUiEvent event) { |  338 void AutofillMetrics::LogDialogUiEvent(DialogUiEvent event) { | 
|  339   UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.UiEvents", event, |  339   UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.UiEvents", event, | 
|  340                             NUM_DIALOG_UI_EVENTS); |  340                             NUM_DIALOG_UI_EVENTS); | 
|  341 } |  341 } | 
|  342  |  342  | 
|  343 // static |  343 // static | 
 |  344 void AutofillMetrics::LogUnmaskPromptEvent(UnmaskPromptEvent event) { | 
 |  345   UMA_HISTOGRAM_ENUMERATION("Autofill.UnmaskPrompt.Events", event, | 
 |  346                             NUM_UNMASK_PROMPT_EVENTS); | 
 |  347 } | 
 |  348  | 
 |  349 // static | 
 |  350 void AutofillMetrics::LogRealPanResult( | 
 |  351     AutofillClient::GetRealPanResult result) { | 
 |  352   GetRealPanResult metric_result; | 
 |  353   switch (result) { | 
 |  354     case AutofillClient::SUCCESS: | 
 |  355       metric_result = GET_REAL_PAN_RESULT_SUCCESS; | 
 |  356       break; | 
 |  357     case AutofillClient::TRY_AGAIN_FAILURE: | 
 |  358       metric_result = GET_REAL_PAN_RESULT_TRY_AGAIN_FAILURE; | 
 |  359       break; | 
 |  360     case AutofillClient::PERMANENT_FAILURE: | 
 |  361       metric_result = GET_REAL_PAN_RESULT_PERMANENT_FAILURE; | 
 |  362       break; | 
 |  363     case AutofillClient::NETWORK_ERROR: | 
 |  364       metric_result = GET_REAL_PAN_RESULT_NETWORK_ERROR; | 
 |  365       break; | 
 |  366     default: | 
 |  367       NOTREACHED(); | 
 |  368       return; | 
 |  369   } | 
 |  370   UMA_HISTOGRAM_ENUMERATION("Autofill.UnmaskPrompt.GetRealPanResult", | 
 |  371                             metric_result, | 
 |  372                             NUM_GET_REAL_PAN_RESULTS); | 
 |  373 } | 
 |  374  | 
 |  375 // static | 
|  344 void AutofillMetrics::LogWalletErrorMetric(WalletErrorMetric metric) { |  376 void AutofillMetrics::LogWalletErrorMetric(WalletErrorMetric metric) { | 
|  345   UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.WalletErrors", metric, |  377   UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.WalletErrors", metric, | 
|  346                             NUM_WALLET_ERROR_METRICS); |  378                             NUM_WALLET_ERROR_METRICS); | 
|  347 } |  379 } | 
|  348  |  380  | 
|  349 // static |  381 // static | 
|  350 void AutofillMetrics::LogWalletApiCallDuration( |  382 void AutofillMetrics::LogWalletApiCallDuration( | 
|  351     WalletApiCallMetric metric, |  383     WalletApiCallMetric metric, | 
|  352     const base::TimeDelta& duration) { |  384     const base::TimeDelta& duration) { | 
|  353   LogUMAHistogramTimes("Wallet.ApiCallDuration." + |  385   LogUMAHistogramTimes("Wallet.ApiCallDuration." + | 
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  604   else if (is_server_data_available_ && !is_local_data_available_) |  636   else if (is_server_data_available_ && !is_local_data_available_) | 
|  605     name += ".WithOnlyServerData"; |  637     name += ".WithOnlyServerData"; | 
|  606   else if (!is_server_data_available_ && is_local_data_available_) |  638   else if (!is_server_data_available_ && is_local_data_available_) | 
|  607     name += ".WithOnlyLocalData"; |  639     name += ".WithOnlyLocalData"; | 
|  608   else |  640   else | 
|  609     name += ".WithBothServerAndLocalData"; |  641     name += ".WithBothServerAndLocalData"; | 
|  610   LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); |  642   LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); | 
|  611 } |  643 } | 
|  612  |  644  | 
|  613 }  // namespace autofill |  645 }  // namespace autofill | 
| OLD | NEW |