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

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

Issue 2586213002: PaymentApp: Implement nativeGetAllAppManifests (Closed)
Patch Set: Rebase Created 4 years 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/ServiceWorkerPaymentAppBridge.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/ServiceWorkerPaymentApp.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java
index 84e3bfa967d11ba0a6f42cb6eac731b11600a1e8..2fad899c517016f1146590fb363d505df955db0d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.payments;
import android.os.Handler;
+import org.chromium.content_public.browser.WebContents;
import org.chromium.payments.mojom.PaymentMethodData;
import java.util.ArrayList;
@@ -24,6 +25,7 @@ import java.util.Set;
* @see https://w3c.github.io/webpayments-payment-apps-api/
*/
public class ServiceWorkerPaymentApp implements PaymentApp {
+ private final WebContents mWebContents;
private final ServiceWorkerPaymentAppBridge.Manifest mManifest;
private final Set<String> mMethodNames;
@@ -32,9 +34,12 @@ public class ServiceWorkerPaymentApp implements PaymentApp {
*
* @see https://w3c.github.io/webpayments-payment-apps-api/#payment-app-manifest
*
+ * @param webContents The web contents where PaymentRequest was invoked.
* @param manifest A manifest that describes this payment app.
*/
- public ServiceWorkerPaymentApp(ServiceWorkerPaymentAppBridge.Manifest manifest) {
+ public ServiceWorkerPaymentApp(
+ WebContents webContents, ServiceWorkerPaymentAppBridge.Manifest manifest) {
+ mWebContents = webContents;
mManifest = manifest;
mMethodNames = new HashSet<>();
@@ -51,7 +56,8 @@ public class ServiceWorkerPaymentApp implements PaymentApp {
new ArrayList<PaymentInstrument>();
for (ServiceWorkerPaymentAppBridge.Option option : mManifest.options) {
- instruments.add(new ServiceWorkerPaymentInstrument(mManifest.scopeUrl, option));
+ instruments.add(new ServiceWorkerPaymentInstrument(
+ mWebContents, mManifest.registrationId, option));
}
new Handler().post(new Runnable() {
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698