| OLD | NEW |
| (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.content.Context; | |
| 8 | |
| 9 import org.chromium.mojo.system.MojoException; | |
| 10 import org.chromium.mojom.payments.PaymentDetails; | |
| 11 import org.chromium.mojom.payments.PaymentOptions; | |
| 12 import org.chromium.mojom.payments.PaymentRequest; | |
| 13 import org.chromium.mojom.payments.PaymentRequestClient; | |
| 14 | |
| 15 /** | |
| 16 * Android implementation of the PaymentRequest service defined in | |
| 17 * third_party/WebKit/public/platform/modules/payments/payment_request.mojom. | |
| 18 */ | |
| 19 public class PaymentRequestDialog implements PaymentRequest { | |
| 20 private final Context mApplicationContext; | |
| 21 private PaymentRequestClient mClient; | |
| 22 | |
| 23 /** | |
| 24 * Builds the dialog. | |
| 25 * | |
| 26 * @param applicationContext The application context. | |
| 27 */ | |
| 28 public PaymentRequestDialog(Context applicationContext) { | |
| 29 mApplicationContext = applicationContext; | |
| 30 } | |
| 31 | |
| 32 @Override | |
| 33 public void setClient(PaymentRequestClient client) { | |
| 34 mClient = client; | |
| 35 } | |
| 36 | |
| 37 @Override | |
| 38 public void show(String[] supportedMethods, PaymentDetails details, PaymentO
ptions options, | |
| 39 String stringifiedData) { | |
| 40 assert mClient != null; | |
| 41 mClient.onError(); | |
| 42 } | |
| 43 | |
| 44 @Override | |
| 45 public void abort() {} | |
| 46 | |
| 47 @Override | |
| 48 public void complete(boolean success) { | |
| 49 assert mClient != null; | |
| 50 mClient.onComplete(); | |
| 51 } | |
| 52 | |
| 53 @Override | |
| 54 public void close() {} | |
| 55 | |
| 56 @Override | |
| 57 public void onConnectionError(MojoException e) {} | |
| 58 } | |
| OLD | NEW |