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 android.app.Activity; | 7 import android.app.Activity; |
8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
9 import android.os.Handler; | 9 import android.os.Handler; |
10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 | 483 |
484 if (!formatter.isValidAmountValue(details.total.amount.value) | 484 if (!formatter.isValidAmountValue(details.total.amount.value) |
485 || details.total.amount.value.startsWith("-")) { | 485 || details.total.amount.value.startsWith("-")) { |
486 disconnectFromClientWithDebugMessage("Invalid total amount value"); | 486 disconnectFromClientWithDebugMessage("Invalid total amount value"); |
487 recordAbortReasonHistogram( | 487 recordAbortReasonHistogram( |
488 PaymentRequestMetrics.ABORT_REASON_INVALID_DATA_FROM_RENDERE R); | 488 PaymentRequestMetrics.ABORT_REASON_INVALID_DATA_FROM_RENDERE R); |
489 return false; | 489 return false; |
490 } | 490 } |
491 | 491 |
492 LineItem uiTotal = new LineItem( | 492 LineItem uiTotal = new LineItem( |
493 details.total.label, totalCurrency, formatter.format(details.tot al.amount.value)); | 493 details.total.label, formatter.formatCurrency(totalCurrency), |
please use gerrit instead
2016/09/02 17:30:55
formatter.getFormattedCurrencyCode(),
pals
2016/09/06 06:09:00
Done.
| |
494 formatter.format(details.total.amount.value)); | |
494 | 495 |
495 List<LineItem> uiLineItems = getValidatedLineItems(details.displayItems, totalCurrency, | 496 List<LineItem> uiLineItems = getValidatedLineItems(details.displayItems, totalCurrency, |
496 formatter); | 497 formatter); |
497 if (uiLineItems == null) { | 498 if (uiLineItems == null) { |
498 disconnectFromClientWithDebugMessage("Invalid line items"); | 499 disconnectFromClientWithDebugMessage("Invalid line items"); |
499 recordAbortReasonHistogram( | 500 recordAbortReasonHistogram( |
500 PaymentRequestMetrics.ABORT_REASON_INVALID_DATA_FROM_RENDERE R); | 501 PaymentRequestMetrics.ABORT_REASON_INVALID_DATA_FROM_RENDERE R); |
501 return false; | 502 return false; |
502 } | 503 } |
503 | 504 |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1096 private void recordAbortReasonHistogram(int abortReason) { | 1097 private void recordAbortReasonHistogram(int abortReason) { |
1097 assert abortReason < PaymentRequestMetrics.ABORT_REASON_MAX; | 1098 assert abortReason < PaymentRequestMetrics.ABORT_REASON_MAX; |
1098 if (mHasRecordedAbortReason) return; | 1099 if (mHasRecordedAbortReason) return; |
1099 | 1100 |
1100 mHasRecordedAbortReason = true; | 1101 mHasRecordedAbortReason = true; |
1101 RecordHistogram.recordEnumeratedHistogram( | 1102 RecordHistogram.recordEnumeratedHistogram( |
1102 "PaymentRequest.CheckoutFunnel.Aborted", abortReason, | 1103 "PaymentRequest.CheckoutFunnel.Aborted", abortReason, |
1103 PaymentRequestMetrics.ABORT_REASON_MAX); | 1104 PaymentRequestMetrics.ABORT_REASON_MAX); |
1104 } | 1105 } |
1105 } | 1106 } |
OLD | NEW |