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

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

Issue 2526293003: PaymentApp: Add classes for supporting Web Based Payment Apps (Closed)
Patch Set: Make the service worker unittests work even with the feature flag off 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.payments;
6
7 import android.graphics.drawable.Drawable;
8
9 import org.chromium.base.annotations.SuppressFBWarnings;
10
11 import java.util.ArrayList;
12 import java.util.List;
13
14 /**
15 * Native bridge for interacting with service worker based payment apps.
16 */
17 // TODO(tommyt): crbug.com/669876. Remove these suppressions when we actually
18 // start using all of the functionality in this class.
19 @SuppressFBWarnings({
20 "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD",
21 "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD"})
22 public class ServiceWorkerPaymentAppBridge {
23 /**
24 * This class represents a payment app manifest as defined in the Payment
25 * App API specification.
26 *
27 * @see https://w3c.github.io/webpayments-payment-apps-api/#payment-app-mani fest
28 */
29 public static class Manifest {
30 /**
31 * The scope url of the service worker.
32 *
33 * This can be used to identify a service worker based payment app.
34 */
35 public String scopeUrl;
36 public String label;
37 public Drawable icon;
38 public List<Option> options = new ArrayList<>();
39 }
40
41 /**
42 * This class represents a payment option as defined in the Payment App API
43 * specification.
44 *
45 * @see https://w3c.github.io/webpayments-payment-apps-api/#payment-app-opti ons
46 */
47 public static class Option {
48 public String id;
49 public String label;
50 public Drawable icon;
51 public List<String> enabledMethods = new ArrayList<>();
52 }
53
54 /**
55 * Get a list of all the installed app manifests.
56 */
57 public List<Manifest> getAllAppManifests() {
58 // TODO(tommyt): crbug.com/669876. Implement this function.
59 return new ArrayList<Manifest>();
60 }
61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698