Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java

Issue 2748093003: PaymentRequest: Introduce PaymentDetailsInit and PaymentDetailsUpdate. (Closed)
Patch Set: PaymentRequest: Introduce PaymentDetailsInit and PaymentDetailsUpdate. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/payments/content/payment_details_validation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
index ca53cbcf63dd9f831990019556b106b7a20b6b33..9d8996ea903acf7e325603c0cb35d7ae94efe054 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -735,15 +735,20 @@ public class PaymentRequestImpl
details.total.amount.currencySystem, Locale.getDefault());
}
- // Total is never pending.
- LineItem uiTotal = new LineItem(details.total.label,
- mCurrencyFormatter.getFormattedCurrencyCode(),
- mCurrencyFormatter.format(details.total.amount.value), /* isPending */ false);
+ if (details.total != null) {
+ mRawTotal = details.total;
+ }
+
+ if (mRawTotal != null) {
please use gerrit instead 2017/03/27 14:00:05 Please remove the lines 740-742. That should make
zino 2017/03/27 14:47:47 Done.
please use gerrit instead 2017/03/27 14:59:39 I'm so sorry. I think you original code was actual
zino 2017/03/27 15:05:55 Oh, right :) Thanks!
+ // Total is never pending.
+ LineItem uiTotal = new LineItem(mRawTotal.label,
+ mCurrencyFormatter.getFormattedCurrencyCode(),
+ mCurrencyFormatter.format(mRawTotal.amount.value), /* isPending */ false);
- List<LineItem> uiLineItems = getLineItems(details.displayItems, mCurrencyFormatter);
+ List<LineItem> uiLineItems = getLineItems(details.displayItems, mCurrencyFormatter);
- mUiShoppingCart = new ShoppingCart(uiTotal, uiLineItems);
- mRawTotal = details.total;
+ mUiShoppingCart = new ShoppingCart(uiTotal, uiLineItems);
+ }
mRawLineItems = Collections.unmodifiableList(Arrays.asList(details.displayItems));
mUiShippingOptions = getShippingOptions(details.shippingOptions, mCurrencyFormatter);
« no previous file with comments | « no previous file | components/payments/content/payment_details_validation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698