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.text.TextUtils; | 8 import android.text.TextUtils; |
9 import android.util.JsonWriter; | 9 import android.util.JsonWriter; |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 * @param billingAddress The billing address for the card. | 53 * @param billingAddress The billing address for the card. |
54 * @param methodName The payment method name, e.g., "basic-card", "visa"
, amex", or null. | 54 * @param methodName The payment method name, e.g., "basic-card", "visa"
, amex", or null. |
55 */ | 55 */ |
56 public AutofillPaymentInstrument(WebContents webContents, CreditCard card, | 56 public AutofillPaymentInstrument(WebContents webContents, CreditCard card, |
57 @Nullable AutofillProfile billingAddress, @Nullable String methodNam
e) { | 57 @Nullable AutofillProfile billingAddress, @Nullable String methodNam
e) { |
58 super(card.getGUID(), card.getObfuscatedNumber(), card.getName(), null); | 58 super(card.getGUID(), card.getObfuscatedNumber(), card.getName(), null); |
59 mWebContents = webContents; | 59 mWebContents = webContents; |
60 mCard = card; | 60 mCard = card; |
61 mBillingAddress = billingAddress; | 61 mBillingAddress = billingAddress; |
62 mIsEditable = true; | 62 mIsEditable = true; |
| 63 mIsPaymentCard = true; |
63 mMethodName = methodName; | 64 mMethodName = methodName; |
64 | 65 |
65 Context context = ChromeActivity.fromWebContents(mWebContents); | 66 Context context = ChromeActivity.fromWebContents(mWebContents); |
66 if (context == null) return; | 67 if (context == null) return; |
67 | 68 |
68 if (card.getIssuerIconDrawableId() != 0) { | 69 if (card.getIssuerIconDrawableId() != 0) { |
69 updateDrawableIcon(ApiCompatibilityUtils.getDrawable( | 70 updateDrawableIcon(ApiCompatibilityUtils.getDrawable( |
70 context.getResources(), card.getIssuerIconDrawableId())); | 71 context.getResources(), card.getIssuerIconDrawableId())); |
71 } | 72 } |
72 | 73 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 /** @return The credit card represented by this payment instrument. */ | 328 /** @return The credit card represented by this payment instrument. */ |
328 public CreditCard getCard() { | 329 public CreditCard getCard() { |
329 return mCard; | 330 return mCard; |
330 } | 331 } |
331 | 332 |
332 /** @return The billing address associated with this credit card. */ | 333 /** @return The billing address associated with this credit card. */ |
333 public AutofillProfile getBillingAddress() { | 334 public AutofillProfile getBillingAddress() { |
334 return mBillingAddress; | 335 return mBillingAddress; |
335 } | 336 } |
336 } | 337 } |
OLD | NEW |