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

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

Issue 2413833002: PaymentRequest: Rename ContactInfo to PayerInfo.
Patch Set: test Created 4 years, 2 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/AutofillPayerInfo.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
deleted file mode 100644
index 37c9fd19d7195b4e7820961ef80b5c4d7c8b72a7..0000000000000000000000000000000000000000
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillContact.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// 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.autofill.PersonalDataManager.AutofillProfile;
-import org.chromium.chrome.browser.payments.ui.PaymentOption;
-
-import javax.annotation.Nullable;
-
-/**
- * The locally stored contact details.
- */
-public class AutofillContact extends PaymentOption {
- private final AutofillProfile mProfile;
- @Nullable private String mPayerPhone;
- @Nullable private String mPayerEmail;
-
- /**
- * Builds contact details.
- *
- * @param profile The autofill profile where this contact data lives.
- * @param phone The phone number. If not empty, this will be the primary label.
- * @param email The email address. If phone is empty, this will be the primary label.
- * @param isComplete Whether the data in this contact can be sent to the merchant as-is. If
- * false, user needs to add more information here.
- */
- public AutofillContact(AutofillProfile profile, @Nullable String phone, @Nullable String email,
- boolean isComplete) {
- super(profile.getGUID(), null, null, PaymentOption.NO_ICON);
- mProfile = profile;
- mIsComplete = isComplete;
- setGuidPhoneEmail(profile.getGUID(), phone, email);
- }
-
- /** @return Email address. Null if the merchant did not request it or data is incomplete. */
- @Nullable public String getPayerEmail() {
- return mPayerEmail;
- }
-
- /** @return Phone number. Null if the merchant did not request it or data is incomplete. */
- @Nullable public String getPayerPhone() {
- return mPayerPhone;
- }
-
- /** @return The autofill profile where this contact data lives. */
- public AutofillProfile getProfile() {
- return mProfile;
- }
-
- /**
- * Updates the profile guid, email address, and phone number and marks this information
- * "complete." Called after the user has edited this contact information. Updates the
- * identifier, label, and sublabel.
- *
- * @param guid The new identifier to use. Should not be null or empty.
- * @param phone The new phone number to use. If not empty, this will be the primary label.
- * @param email The new email address to use. If phone is empty, this will be the primary label.
- */
- public void completeContact(String guid, @Nullable String phone, @Nullable String email) {
- mIsComplete = true;
- setGuidPhoneEmail(guid, phone, email);
- }
-
- private void setGuidPhoneEmail(String guid, @Nullable String phone, @Nullable String email) {
- mPayerPhone = TextUtils.isEmpty(phone) ? null : phone;
- mPayerEmail = TextUtils.isEmpty(email) ? null : email;
- updateIdentifierAndLabels(guid, mPayerPhone == null ? mPayerEmail : mPayerPhone,
- mPayerPhone == null ? null : mPayerEmail);
- }
-}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillPayerInfo.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698