Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestActivity.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestActivity.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..516ff4aae97ee0aa1a962833c7777703e6c5f00c |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestActivity.java |
| @@ -0,0 +1,58 @@ |
| +// 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.content.Context; |
| + |
| +import org.chromium.mojo.system.MojoException; |
| +import org.chromium.mojom.payments.PaymentDetails; |
| +import org.chromium.mojom.payments.PaymentOptions; |
| +import org.chromium.mojom.payments.PaymentRequest; |
| +import org.chromium.mojom.payments.PaymentRequestClient; |
| + |
| +/** |
| + * Android implementation of the PaymentRequest service defined in |
| + * third_party/WebKit/public/platform/modules/payments/payment_request.mojom. |
| + */ |
| +public class PaymentRequestActivity implements PaymentRequest { |
|
Ted C
2016/03/28 22:46:01
Activity? Or Dialog?
Although I was not 100% ant
|
| + private final Context mApplicationContext; |
| + private PaymentRequestClient mClient; |
| + |
| + /** |
| + * Builds a PaymentRequest. |
| + * |
| + * @param applicationContext The application context. |
| + */ |
| + public PaymentRequestActivity(Context applicationContext) { |
| + mApplicationContext = applicationContext; |
| + } |
| + |
| + @Override |
| + public void setClient(PaymentRequestClient client) { |
| + mClient = client; |
| + } |
| + |
| + @Override |
| + public void show(String[] supportedMethods, PaymentDetails details, PaymentOptions options, |
| + String stringifiedData) { |
| + assert mClient != null; |
| + mClient.onError(); |
| + } |
| + |
| + @Override |
| + public void abort() {} |
| + |
| + @Override |
| + public void complete(boolean success) { |
| + assert mClient != null; |
| + mClient.onComplete(); |
| + } |
| + |
| + @Override |
| + public void close() {} |
| + |
| + @Override |
| + public void onConnectionError(MojoException e) {} |
| +} |