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

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

Issue 2030193002: Add 'total' field to 'PaymentDetails'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, address comments, and add more tests Created 4 years, 6 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
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShoppingCart.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShoppingCart.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShoppingCart.java
new file mode 100644
index 0000000000000000000000000000000000000000..f3ef53909cb227dea15111688ef19e3f1aad4eb8
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ShoppingCart.java
@@ -0,0 +1,62 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.payments.ui;
+
+import java.util.List;
+
+/**
+ * The shopping cart contents and total.
+ */
+public class ShoppingCart {
+ private LineItem mTotal;
+ private List<LineItem> mContents;
+
+ /**
+ * Builds the shopping cart UI data model.
+ *
+ * @param totalPrice The total price.
+ * @param contents The shopping cart contents. The breakdown of the total price. OK to be null.
+ */
+ public ShoppingCart(LineItem totalPrice, List<LineItem> contents) {
+ mTotal = totalPrice;
+ mContents = contents;
+ }
+
+ /**
+ * Returns the total price.
+ *
+ * @return The total price.
+ */
+ public LineItem getTotal() {
+ return mTotal;
+ }
+
+ /**
+ * Updates the total price.
+ *
+ * @param total The total price.
+ */
+ public void setTotal(LineItem total) {
+ mTotal = total;
+ }
+
+ /**
+ * Returns the shopping cart items.
+ *
+ * @return The shopping cart items. Can be null.
+ */
+ public List<LineItem> getContents() {
+ return mContents;
+ }
+
+ /**
+ * Updates the shopping cart items.
+ *
+ * @param contents The shopping cart items. Can be null.
+ */
+ public void setContents(List<LineItem> contents) {
+ mContents = contents;
+ }
+}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698