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

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

Issue 2925063003: [Payments] Implement payment instrument icons (Closed)
Patch Set: fix comment lines Created 3 years, 6 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/ServiceWorkerPaymentInstrument.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/ServiceWorkerPaymentAppBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java
index bd25589d75d012c0e2544393ac33817b3f6b4c4c..fd6f1208f9e773e4346211a5781bf1cd41dba98f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java
@@ -4,8 +4,13 @@
package org.chromium.chrome.browser.payments;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.drawable.BitmapDrawable;
+
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.SuppressFBWarnings;
+import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.content_public.browser.WebContents;
import org.chromium.payments.mojom.PaymentDetailsModifier;
import org.chromium.payments.mojom.PaymentItem;
@@ -62,13 +67,19 @@ public class ServiceWorkerPaymentAppBridge implements PaymentAppFactory.PaymentA
@CalledByNative
private static void addInstrument(List<PaymentInstrument> instruments, WebContents webContents,
- long swRegistrationId, String instrumentId, String label, String[] methodNameArray) {
+ long swRegistrationId, String instrumentId, String label, String[] methodNameArray,
+ Bitmap icon) {
+ Context context = ChromeActivity.fromWebContents(webContents);
+ if (context == null) return;
+
Set<String> methodNames = new HashSet<String>();
for (int i = 0; i < methodNameArray.length; i++) {
methodNames.add(methodNameArray[i]);
}
- instruments.add(new ServiceWorkerPaymentInstrument(
- webContents, swRegistrationId, instrumentId, label, methodNames));
+
+ instruments.add(
+ new ServiceWorkerPaymentInstrument(webContents, swRegistrationId, instrumentId,
+ label, methodNames, new BitmapDrawable(context.getResources(), icon)));
}
@CalledByNative
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentInstrument.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698