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

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

Issue 2066483010: Phone and email selection UI for PaymentRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix integration test 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java » ('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/AutofillContact.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillContact.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillContact.java
new file mode 100644
index 0000000000000000000000000000000000000000..980230785ffb196281c86663141d3ebc5d4dc36a
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillContact.java
@@ -0,0 +1,49 @@
+// 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;
+
+import android.text.TextUtils;
+
+import org.chromium.chrome.browser.payments.ui.PaymentOption;
+
+/**
+ * The locally stored contact details.
+ */
+public class AutofillContact extends PaymentOption {
+ private final String mPayerEmail;
+ private final String mPayerPhone;
+
+ /**
+ * Builds contact details.
+ *
+ * @param email Email address.
+ * @param phone Phone number.
+ */
+ public AutofillContact(String email, String phone) {
+ super(null, TextUtils.isEmpty(phone) ? email : phone,
+ TextUtils.isEmpty(phone) ? null : email, PaymentOption.NO_ICON);
+ mPayerEmail = TextUtils.isEmpty(email) ? null : email;
+ mPayerPhone = TextUtils.isEmpty(phone) ? null : phone;
+ assert mPayerEmail != null || mPayerPhone != null;
+ }
+
+ /**
+ * Returns the email address for mojo.
+ *
+ * @return Email address. Null if merchant did not request it.
+ */
+ public String getPayerEmail() {
+ return mPayerEmail;
+ }
+
+ /**
+ * Returns the phone number for mojo.
+ *
+ * @return Phone number. Null if merchant did not request it.
+ */
+ public String getPayerPhone() {
+ return mPayerPhone;
+ }
+}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698