Chromium Code Reviews| 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 metricResult; | |
|
Ilya Sherman
2015/03/19 00:16:01
nit: hacker_case
| |
| 353 switch (result) { | |
| 354 case AutofillClient::SUCCESS: { | |
| 355 metricResult = GET_REAL_PAN_RESULT_SUCCESS; | |
| 356 break; | |
| 357 } | |
|
Ilya Sherman
2015/03/19 00:16:01
nit: No need for curly braces.
| |
| 358 case AutofillClient::TRY_AGAIN_FAILURE: { | |
| 359 metricResult = GET_REAL_PAN_RESULT_TRY_AGAIN_FAILURE; | |
| 360 break; | |
| 361 } | |
| 362 case AutofillClient::PERMANENT_FAILURE: { | |
| 363 metricResult = GET_REAL_PAN_RESULT_PERMANENT_FAILURE; | |
| 364 break; | |
| 365 } | |
| 366 case AutofillClient::NETWORK_ERROR: { | |
| 367 metricResult = GET_REAL_PAN_RESULT_NETWORK_ERROR; | |
| 368 break; | |
| 369 } | |
| 370 } | |
| 371 UMA_HISTOGRAM_ENUMERATION("Autofill.UnmaskPrompt.GetRealPanResult", | |
| 372 metricResult, | |
| 373 NUM_GET_REAL_PAN_RESULTS); | |
| 374 } | |
| 375 | |
| 376 // static | |
| 344 void AutofillMetrics::LogWalletErrorMetric(WalletErrorMetric metric) { | 377 void AutofillMetrics::LogWalletErrorMetric(WalletErrorMetric metric) { |
| 345 UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.WalletErrors", metric, | 378 UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.WalletErrors", metric, |
| 346 NUM_WALLET_ERROR_METRICS); | 379 NUM_WALLET_ERROR_METRICS); |
| 347 } | 380 } |
| 348 | 381 |
| 349 // static | 382 // static |
| 350 void AutofillMetrics::LogWalletApiCallDuration( | 383 void AutofillMetrics::LogWalletApiCallDuration( |
| 351 WalletApiCallMetric metric, | 384 WalletApiCallMetric metric, |
| 352 const base::TimeDelta& duration) { | 385 const base::TimeDelta& duration) { |
| 353 LogUMAHistogramTimes("Wallet.ApiCallDuration." + | 386 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_) | 637 else if (is_server_data_available_ && !is_local_data_available_) |
| 605 name += ".WithOnlyServerData"; | 638 name += ".WithOnlyServerData"; |
| 606 else if (!is_server_data_available_ && is_local_data_available_) | 639 else if (!is_server_data_available_ && is_local_data_available_) |
| 607 name += ".WithOnlyLocalData"; | 640 name += ".WithOnlyLocalData"; |
| 608 else | 641 else |
| 609 name += ".WithBothServerAndLocalData"; | 642 name += ".WithBothServerAndLocalData"; |
| 610 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); | 643 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); |
| 611 } | 644 } |
| 612 | 645 |
| 613 } // namespace autofill | 646 } // namespace autofill |
| OLD | NEW |