Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/WebBasedPaymentAppBridge.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/WebBasedPaymentAppBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/WebBasedPaymentAppBridge.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7bfd6178719a8a2ed1b9c9f6730dab231e339e2b |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/WebBasedPaymentAppBridge.java |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.browser.payments; |
| + |
| +import android.graphics.drawable.Drawable; |
| + |
| +import java.util.ArrayList; |
| +import java.util.List; |
| + |
| +/** |
| + * Native bridge for interacting with web based payment apps. |
| + */ |
| +public class WebBasedPaymentAppBridge { |
| + /** |
| + * This class represents a payment app manifest as defined in the Payment |
| + * App API specification. |
| + * |
| + * @see https://w3c.github.io/webpayments-payment-apps-api/#payment-app-manifest |
| + */ |
| + public class Manifest { |
|
agrieve
2016/11/28 17:59:53
Should these inner classes be static?
tommyt
2016/11/30 13:44:38
Done.
|
| + public String id; |
|
please use gerrit instead
2016/11/29 14:28:44
Manifest does not have an ID field.
tommyt
2016/11/30 13:44:38
True, but the Payment App does have an ID, and I t
zino
2016/11/30 14:04:46
IMHO, you can rename the field to scopeUrl and the
tommyt
2016/11/30 14:14:00
This sounds like a good idea. Maybe this is better
please use gerrit instead
2016/11/30 15:08:28
+1
tommyt
2016/12/01 13:55:49
Done.
|
| + public String label; |
| + public Drawable icon; |
| + public List<Option> options = new ArrayList<>(); |
| + } |
| + |
| + /** |
| + * This class represents a payment option as defined in the Payment App API |
| + * specification. |
| + * |
| + * @see https://w3c.github.io/webpayments-payment-apps-api/#payment-app-options |
| + */ |
| + public class Option { |
| + public String id; |
| + public String label; |
| + public Drawable icon; |
| + public List<String> enabledMethods = new ArrayList<>(); |
| + } |
| + |
| + /** |
| + * Get a list of all the installed app manifests. |
| + */ |
| + public List<Manifest> getAllAppManifests() { |
| + // Not yet implemented |
|
please use gerrit instead
2016/11/29 14:28:44
Add a TODO.
tommyt
2016/11/30 13:44:38
Done.
|
| + return new ArrayList<Manifest>(); |
| + } |
| +} |