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.app.Activity; | 7 import android.app.Activity; |
8 | 8 |
9 import org.chromium.chrome.browser.ChromeFeatureList; | 9 import org.chromium.chrome.browser.ChromeFeatureList; |
10 import org.chromium.content.browser.ContentViewCore; | 10 import org.chromium.content.browser.ContentViewCore; |
11 import org.chromium.content_public.browser.WebContents; | 11 import org.chromium.content_public.browser.WebContents; |
12 import org.chromium.mojo.system.MojoException; | 12 import org.chromium.mojo.system.MojoException; |
13 import org.chromium.payments.mojom.ActivePaymentQueryResult; | 13 import org.chromium.payments.mojom.CanMakePaymentQueryResult; |
14 import org.chromium.payments.mojom.PaymentDetails; | 14 import org.chromium.payments.mojom.PaymentDetails; |
15 import org.chromium.payments.mojom.PaymentErrorReason; | 15 import org.chromium.payments.mojom.PaymentErrorReason; |
16 import org.chromium.payments.mojom.PaymentMethodData; | 16 import org.chromium.payments.mojom.PaymentMethodData; |
17 import org.chromium.payments.mojom.PaymentOptions; | 17 import org.chromium.payments.mojom.PaymentOptions; |
18 import org.chromium.payments.mojom.PaymentRequest; | 18 import org.chromium.payments.mojom.PaymentRequest; |
19 import org.chromium.payments.mojom.PaymentRequestClient; | 19 import org.chromium.payments.mojom.PaymentRequestClient; |
20 import org.chromium.services.service_manager.InterfaceFactory; | 20 import org.chromium.services.service_manager.InterfaceFactory; |
21 import org.chromium.ui.base.WindowAndroid; | 21 import org.chromium.ui.base.WindowAndroid; |
22 | 22 |
23 /** | 23 /** |
(...skipping 26 matching lines...) Expand all Loading... |
50 @Override | 50 @Override |
51 public void updateWith(PaymentDetails details) {} | 51 public void updateWith(PaymentDetails details) {} |
52 | 52 |
53 @Override | 53 @Override |
54 public void abort() {} | 54 public void abort() {} |
55 | 55 |
56 @Override | 56 @Override |
57 public void complete(int result) {} | 57 public void complete(int result) {} |
58 | 58 |
59 @Override | 59 @Override |
60 public void canMakeActivePayment() { | 60 public void canMakePayment() { |
61 if (mClient != null) { | 61 if (mClient != null) { |
62 mClient.onCanMakeActivePayment(ActivePaymentQueryResult.CANNOT_M
AKE_ACTIVE_PAYMENT); | 62 mClient.onCanMakePayment(CanMakePaymentQueryResult.CANNOT_MAKE_P
AYMENT); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 @Override | 66 @Override |
67 public void close() {} | 67 public void close() {} |
68 | 68 |
69 @Override | 69 @Override |
70 public void onConnectionError(MojoException e) {} | 70 public void onConnectionError(MojoException e) {} |
71 } | 71 } |
72 | 72 |
(...skipping 19 matching lines...) Expand all Loading... |
92 | 92 |
93 WindowAndroid window = contentViewCore.getWindowAndroid(); | 93 WindowAndroid window = contentViewCore.getWindowAndroid(); |
94 if (window == null) return new InvalidPaymentRequest(); | 94 if (window == null) return new InvalidPaymentRequest(); |
95 | 95 |
96 Activity context = window.getActivity().get(); | 96 Activity context = window.getActivity().get(); |
97 if (context == null) return new InvalidPaymentRequest(); | 97 if (context == null) return new InvalidPaymentRequest(); |
98 | 98 |
99 return new PaymentRequestImpl(context, mWebContents); | 99 return new PaymentRequestImpl(context, mWebContents); |
100 } | 100 } |
101 } | 101 } |
OLD | NEW |