| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 package org.chromium.chrome.browser.payments; | 5 package org.chromium.chrome.browser.payments; |
| 6 | 6 |
| 7 import org.chromium.base.VisibleForTesting; | 7 import org.chromium.base.VisibleForTesting; |
| 8 import org.chromium.base.metrics.RecordHistogram; | 8 import org.chromium.base.metrics.RecordHistogram; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 public static final int ABORT_REASON_ABORTED_BY_MERCHANT = 1; | 33 public static final int ABORT_REASON_ABORTED_BY_MERCHANT = 1; |
| 34 @VisibleForTesting | 34 @VisibleForTesting |
| 35 public static final int ABORT_REASON_INVALID_DATA_FROM_RENDERER = 2; | 35 public static final int ABORT_REASON_INVALID_DATA_FROM_RENDERER = 2; |
| 36 @VisibleForTesting | 36 @VisibleForTesting |
| 37 public static final int ABORT_REASON_MOJO_CONNECTION_ERROR = 3; | 37 public static final int ABORT_REASON_MOJO_CONNECTION_ERROR = 3; |
| 38 @VisibleForTesting | 38 @VisibleForTesting |
| 39 public static final int ABORT_REASON_MOJO_RENDERER_CLOSING = 4; | 39 public static final int ABORT_REASON_MOJO_RENDERER_CLOSING = 4; |
| 40 @VisibleForTesting | 40 @VisibleForTesting |
| 41 public static final int ABORT_REASON_INSTRUMENT_DETAILS_ERROR = 5; | 41 public static final int ABORT_REASON_INSTRUMENT_DETAILS_ERROR = 5; |
| 42 @VisibleForTesting | 42 @VisibleForTesting |
| 43 public static final int ABORT_REASON_NO_MATCHING_PAYMENT_METHOD = 6; | 43 public static final int ABORT_REASON_NO_MATCHING_PAYMENT_METHOD = 6; // Depr
ecated. |
| 44 @VisibleForTesting | 44 @VisibleForTesting |
| 45 public static final int ABORT_REASON_NO_SUPPORTED_PAYMENT_METHOD = 7; | 45 public static final int ABORT_REASON_NO_SUPPORTED_PAYMENT_METHOD = 7; // Dep
recated. |
| 46 @VisibleForTesting | 46 @VisibleForTesting |
| 47 public static final int ABORT_REASON_OTHER = 8; | 47 public static final int ABORT_REASON_OTHER = 8; |
| 48 @VisibleForTesting | 48 @VisibleForTesting |
| 49 public static final int ABORT_REASON_MAX = 9; | 49 public static final int ABORT_REASON_MAX = 9; |
| 50 | 50 |
| 51 // PaymentRequestNoShowReason defined in tools/metrics/histograms/histograms
.xml |
| 52 @VisibleForTesting |
| 53 public static final int NO_SHOW_NO_MATCHING_PAYMENT_METHOD = 0; |
| 54 @VisibleForTesting |
| 55 public static final int NO_SHOW_NO_SUPPORTED_PAYMENT_METHOD = 1; |
| 56 @VisibleForTesting |
| 57 public static final int NO_SHOW_REASON_MAX = 2; |
| 58 |
| 51 // PaymentRequestPaymentMethods defined in tools/metrics/histograms/histogra
ms.xml. | 59 // PaymentRequestPaymentMethods defined in tools/metrics/histograms/histogra
ms.xml. |
| 52 @VisibleForTesting | 60 @VisibleForTesting |
| 53 public static final int SELECTED_METHOD_CREDIT_CARD = 0; | 61 public static final int SELECTED_METHOD_CREDIT_CARD = 0; |
| 54 @VisibleForTesting | 62 @VisibleForTesting |
| 55 public static final int SELECTED_METHOD_ANDROID_PAY = 1; | 63 public static final int SELECTED_METHOD_ANDROID_PAY = 1; |
| 56 @VisibleForTesting | 64 @VisibleForTesting |
| 57 public static final int SELECTED_METHOD_OTHER_PAYMENT_APP = 2; | 65 public static final int SELECTED_METHOD_OTHER_PAYMENT_APP = 2; |
| 58 @VisibleForTesting | 66 @VisibleForTesting |
| 59 public static final int SELECTED_METHOD_MAX = 3; | 67 public static final int SELECTED_METHOD_MAX = 3; |
| 60 | 68 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 86 * Request transaction. | 94 * Request transaction. |
| 87 * | 95 * |
| 88 * @param paymentMethod The payment method that was used to complete the cur
rent transaction. | 96 * @param paymentMethod The payment method that was used to complete the cur
rent transaction. |
| 89 */ | 97 */ |
| 90 public static void recordSelectedPaymentMethodHistogram(int paymentMethod) { | 98 public static void recordSelectedPaymentMethodHistogram(int paymentMethod) { |
| 91 assert paymentMethod < SELECTED_METHOD_MAX; | 99 assert paymentMethod < SELECTED_METHOD_MAX; |
| 92 RecordHistogram.recordEnumeratedHistogram("PaymentRequest.SelectedPaymen
tMethod", | 100 RecordHistogram.recordEnumeratedHistogram("PaymentRequest.SelectedPaymen
tMethod", |
| 93 paymentMethod, SELECTED_METHOD_MAX); | 101 paymentMethod, SELECTED_METHOD_MAX); |
| 94 } | 102 } |
| 95 } | 103 } |
| OLD | NEW |