Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java |
| index 162ef5a60c294a37c50b6795c4d6c37cb2798d28..269b72ddf5a2e4a3fae58669b5bed371209193dc 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java |
| @@ -4,6 +4,8 @@ |
| package org.chromium.chrome.browser.payments.ui; |
| +import android.graphics.drawable.Drawable; |
| + |
| import javax.annotation.Nullable; |
| /** |
| @@ -11,17 +13,15 @@ import javax.annotation.Nullable; |
| * method. |
| */ |
| public class PaymentOption implements Completable { |
| - /** The placeholder value that indicates the absence of an icon for this option. */ |
| - public static final int NO_ICON = 0; |
| - |
| protected boolean mIsComplete; |
| private String mId; |
| - private int mIcon; |
| + private Drawable mIcon; |
| private String[] mLabels = {null, null, null}; |
| private boolean mIsValid = true; |
| /** See {@link #PaymentOption(String, String, String, String, int)}. */ |
| - public PaymentOption(String id, @Nullable String label, @Nullable String sublabel, int icon) { |
| + public PaymentOption(String id, @Nullable String label, @Nullable String sublabel, |
| + @Nullable Drawable icon) { |
| this(id, label, sublabel, null, icon); |
| } |
| @@ -32,10 +32,10 @@ public class PaymentOption implements Completable { |
| * @param label The label. |
| * @param sublabel The optional sublabel. |
| * @param tertiarylabel The optional tertiary label. |
| - * @param icon The drawable icon identifier or NO_ICON. |
| + * @param icon The drawable icon identifier or null. |
| */ |
| public PaymentOption(String id, @Nullable String label, @Nullable String sublabel, |
| - @Nullable String tertiarylabel, int icon) { |
| + @Nullable String tertiarylabel, @Nullable Drawable icon) { |
| updateIdentifierLabelsAndIcon(id, label, sublabel, tertiarylabel, icon); |
| } |
| @@ -95,20 +95,19 @@ public class PaymentOption implements Completable { |
| * @param label The new label to use. Should not be null. |
| * @param sublabel The new sublabel to use. Can be null. |
| * @param tertiarylabel The new tertiary label to use. Can be null. |
| - * @param icon The drawable icon identifier or NO_ICON. |
| + * @param icon The drawable icon identifier or null. |
| */ |
| protected void updateIdentifierLabelsAndIcon( |
| String id, String label, @Nullable String sublabel, @Nullable String tertiarylabel, |
| - int icon) { |
| + @Nullable Drawable icon) { |
| updateIdentifierAndLabels(id, label, sublabel, tertiarylabel); |
| mIcon = icon; |
| } |
| /** |
| - * The identifier for the drawable icon for this payment option. For example, R.drawable.pr_visa |
| - * or NO_ICON. |
| + * The drawable icon for this payment option. |
| */ |
|
please use gerrit instead
2016/10/20 15:22:18
This comment is short enough to collapse into a si
|
| - public int getDrawableIconId() { |
| + public Drawable getDrawableIcon() { |
| return mIcon; |
| } |