| 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; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 * @param card The new credit card to use. The GUID should not cha
nge. | 212 * @param card The new credit card to use. The GUID should not cha
nge. |
| 213 * @param billingAddress The billing address for the card. The GUID should m
atch the billing | 213 * @param billingAddress The billing address for the card. The GUID should m
atch the billing |
| 214 * address ID of the new card to use. | 214 * address ID of the new card to use. |
| 215 */ | 215 */ |
| 216 public void completeInstrument(CreditCard card, AutofillProfile billingAddre
ss) { | 216 public void completeInstrument(CreditCard card, AutofillProfile billingAddre
ss) { |
| 217 assert card != null; | 217 assert card != null; |
| 218 assert billingAddress != null; | 218 assert billingAddress != null; |
| 219 assert card.getBillingAddressId() != null; | 219 assert card.getBillingAddressId() != null; |
| 220 assert card.getBillingAddressId().equals(billingAddress.getGUID()); | 220 assert card.getBillingAddressId().equals(billingAddress.getGUID()); |
| 221 assert card.getIssuerIconDrawableId() != 0; | 221 assert card.getIssuerIconDrawableId() != 0; |
| 222 assert AutofillAddress.checkAddressCompletionStatus(billingAddress) |
| 223 == AutofillAddress.COMPLETE; |
| 222 | 224 |
| 223 mCard = card; | 225 mCard = card; |
| 224 mBillingAddress = billingAddress; | 226 mBillingAddress = billingAddress; |
| 225 updateIdentifierLabelsAndIcon(card.getGUID(), card.getObfuscatedNumber()
, card.getName(), | 227 updateIdentifierLabelsAndIcon(card.getGUID(), card.getObfuscatedNumber()
, card.getName(), |
| 226 null, ApiCompatibilityUtils.getDrawable( | 228 null, ApiCompatibilityUtils.getDrawable( |
| 227 mContext.getResources(), card.getIssuerIconDrawabl
eId())); | 229 mContext.getResources(), card.getIssuerIconDrawabl
eId())); |
| 228 checkAndUpateCardCompleteness(); | 230 checkAndUpateCardCompleteness(); |
| 229 assert mIsComplete; | 231 assert mIsComplete; |
| 230 } | 232 } |
| 231 | 233 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 /** @return The credit card represented by this payment instrument. */ | 284 /** @return The credit card represented by this payment instrument. */ |
| 283 public CreditCard getCard() { | 285 public CreditCard getCard() { |
| 284 return mCard; | 286 return mCard; |
| 285 } | 287 } |
| 286 | 288 |
| 287 /** @return The billing address associated with this credit card. */ | 289 /** @return The billing address associated with this credit card. */ |
| 288 public AutofillProfile getBillingAddress() { | 290 public AutofillProfile getBillingAddress() { |
| 289 return mBillingAddress; | 291 return mBillingAddress; |
| 290 } | 292 } |
| 291 } | 293 } |
| OLD | NEW |