| 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.os.Handler; | 7 import android.os.Handler; |
| 8 | 8 |
| 9 import org.chromium.content_public.browser.WebContents; | 9 import org.chromium.content_public.browser.WebContents; |
| 10 import org.chromium.payments.mojom.PaymentMethodData; | 10 import org.chromium.payments.mojom.PaymentMethodData; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 mManifest = manifest; | 43 mManifest = manifest; |
| 44 | 44 |
| 45 mMethodNames = new HashSet<>(); | 45 mMethodNames = new HashSet<>(); |
| 46 for (ServiceWorkerPaymentAppBridge.Option option : manifest.options) { | 46 for (ServiceWorkerPaymentAppBridge.Option option : manifest.options) { |
| 47 mMethodNames.addAll(option.enabledMethods); | 47 mMethodNames.addAll(option.enabledMethods); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 @Override | 51 @Override |
| 52 public void getInstruments(Map<String, PaymentMethodData> unusedMethodDataMa
p, | 52 public void getInstruments(Map<String, PaymentMethodData> unusedMethodDataMa
p, |
| 53 String unusedOrigin, final InstrumentsCallback callback) { | 53 String unusedOrigin, byte[][] unusedCertificateChain, |
| 54 final InstrumentsCallback callback) { |
| 54 final List<PaymentInstrument> instruments = | 55 final List<PaymentInstrument> instruments = |
| 55 new ArrayList<PaymentInstrument>(); | 56 new ArrayList<PaymentInstrument>(); |
| 56 | 57 |
| 57 for (ServiceWorkerPaymentAppBridge.Option option : mManifest.options) { | 58 for (ServiceWorkerPaymentAppBridge.Option option : mManifest.options) { |
| 58 instruments.add(new ServiceWorkerPaymentInstrument( | 59 instruments.add(new ServiceWorkerPaymentInstrument( |
| 59 mWebContents, mManifest.registrationId, option)); | 60 mWebContents, mManifest.registrationId, option)); |
| 60 } | 61 } |
| 61 | 62 |
| 62 new Handler().post(new Runnable() { | 63 new Handler().post(new Runnable() { |
| 63 @Override | 64 @Override |
| (...skipping 12 matching lines...) Expand all Loading... |
| 76 public boolean supportsMethodsAndData(Map<String, PaymentMethodData> methods
AndData) { | 77 public boolean supportsMethodsAndData(Map<String, PaymentMethodData> methods
AndData) { |
| 77 // TODO(tommyt): crbug.com/669876. Implement this for Service Worker Pay
ment Apps. | 78 // TODO(tommyt): crbug.com/669876. Implement this for Service Worker Pay
ment Apps. |
| 78 return true; | 79 return true; |
| 79 } | 80 } |
| 80 | 81 |
| 81 @Override | 82 @Override |
| 82 public String getAppIdentifier() { | 83 public String getAppIdentifier() { |
| 83 return "Chrome_Service_Worker_Payment_App"; | 84 return "Chrome_Service_Worker_Payment_App"; |
| 84 } | 85 } |
| 85 } | 86 } |
| OLD | NEW |