| 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.content.Context; | 7 import android.content.Context; |
| 8 import android.os.Handler; | 8 import android.os.Handler; |
| 9 import android.text.TextUtils; | 9 import android.text.TextUtils; |
| 10 import android.util.JsonWriter; | 10 import android.util.JsonWriter; |
| 11 | 11 |
| 12 import org.chromium.base.ApiCompatibilityUtils; | 12 import org.chromium.base.ApiCompatibilityUtils; |
| 13 import org.chromium.chrome.R; | 13 import org.chromium.chrome.R; |
| 14 import org.chromium.chrome.browser.autofill.PersonalDataManager; | 14 import org.chromium.chrome.browser.autofill.PersonalDataManager; |
| 15 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; | 15 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
| 16 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; | 16 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; |
| 17 import org.chromium.chrome.browser.autofill.PersonalDataManager.FullCardRequestD
elegate; | 17 import org.chromium.chrome.browser.autofill.PersonalDataManager.FullCardRequestD
elegate; |
| 18 import org.chromium.chrome.browser.autofill.PersonalDataManager.NormalizedAddres
sRequestDelegate; | 18 import org.chromium.chrome.browser.autofill.PersonalDataManager.NormalizedAddres
sRequestDelegate; |
| 19 import org.chromium.content_public.browser.WebContents; | 19 import org.chromium.content_public.browser.WebContents; |
| 20 import org.chromium.payments.mojom.PaymentDetailsModifier; |
| 20 import org.chromium.payments.mojom.PaymentItem; | 21 import org.chromium.payments.mojom.PaymentItem; |
| 21 import org.chromium.payments.mojom.PaymentMethodData; | 22 import org.chromium.payments.mojom.PaymentMethodData; |
| 22 | 23 |
| 23 import java.io.IOException; | 24 import java.io.IOException; |
| 24 import java.io.StringWriter; | 25 import java.io.StringWriter; |
| 25 import java.util.HashSet; | 26 import java.util.HashSet; |
| 26 import java.util.List; | 27 import java.util.List; |
| 27 import java.util.Map; | 28 import java.util.Map; |
| 28 import java.util.Set; | 29 import java.util.Set; |
| 29 | 30 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 73 |
| 73 @Override | 74 @Override |
| 74 public Set<String> getInstrumentMethodNames() { | 75 public Set<String> getInstrumentMethodNames() { |
| 75 Set<String> result = new HashSet<>(); | 76 Set<String> result = new HashSet<>(); |
| 76 result.add(mMethodName); | 77 result.add(mMethodName); |
| 77 return result; | 78 return result; |
| 78 } | 79 } |
| 79 | 80 |
| 80 @Override | 81 @Override |
| 81 public void invokePaymentApp(String unusedMerchantName, String unusedOrigin, | 82 public void invokePaymentApp(String unusedMerchantName, String unusedOrigin, |
| 82 PaymentItem unusedTotal, List<PaymentItem> unusedCart, | 83 Map<String, PaymentMethodData> unusedMethodDataMap, PaymentItem unus
edTotal, |
| 83 Map<String, PaymentMethodData> unusedMethodDataMap, | 84 List<PaymentItem> unusedDisplayItems, |
| 85 Map<String, PaymentDetailsModifier> unusedModifiers, |
| 84 InstrumentDetailsCallback callback) { | 86 InstrumentDetailsCallback callback) { |
| 85 // The billing address should never be null for a credit card at this po
int. | 87 // The billing address should never be null for a credit card at this po
int. |
| 86 assert mBillingAddress != null; | 88 assert mBillingAddress != null; |
| 87 assert AutofillAddress.checkAddressCompletionStatus(mBillingAddress) | 89 assert AutofillAddress.checkAddressCompletionStatus(mBillingAddress) |
| 88 == AutofillAddress.COMPLETE; | 90 == AutofillAddress.COMPLETE; |
| 89 assert mIsComplete; | 91 assert mIsComplete; |
| 90 assert mHasValidNumberAndName; | 92 assert mHasValidNumberAndName; |
| 91 assert mCallback == null; | 93 assert mCallback == null; |
| 92 mCallback = callback; | 94 mCallback = callback; |
| 93 | 95 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 /** @return The credit card represented by this payment instrument. */ | 325 /** @return The credit card represented by this payment instrument. */ |
| 324 public CreditCard getCard() { | 326 public CreditCard getCard() { |
| 325 return mCard; | 327 return mCard; |
| 326 } | 328 } |
| 327 | 329 |
| 328 /** @return The billing address associated with this credit card. */ | 330 /** @return The billing address associated with this credit card. */ |
| 329 public AutofillProfile getBillingAddress() { | 331 public AutofillProfile getBillingAddress() { |
| 330 return mBillingAddress; | 332 return mBillingAddress; |
| 331 } | 333 } |
| 332 } | 334 } |
| OLD | NEW |