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.components.payments; |
6 | 6 |
7 import org.chromium.base.annotations.JNINamespace; | 7 import org.chromium.base.annotations.JNINamespace; |
8 import org.chromium.payments.mojom.PaymentDetails; | 8 import org.chromium.payments.mojom.PaymentDetails; |
9 | 9 |
10 import java.nio.ByteBuffer; | 10 import java.nio.ByteBuffer; |
11 | 11 |
12 /** | 12 /** |
13 * Static class to represent a JNI interface to a C++ validation library. | 13 * Static class to represent a JNI interface to a C++ validation library. |
14 */ | 14 */ |
15 @JNINamespace("payments") | 15 @JNINamespace("payments") |
16 public class PaymentValidator { | 16 public class PaymentValidator { |
17 public static boolean validatePaymentDetails(PaymentDetails details) { | 17 public static boolean validatePaymentDetails(PaymentDetails details) { |
18 if (details == null) { | 18 if (details == null) { |
19 return false; | 19 return false; |
20 } | 20 } |
21 return nativeValidatePaymentDetails(details.serialize()); | 21 return nativeValidatePaymentDetails(details.serialize()); |
22 } | 22 } |
23 | 23 |
24 private static native boolean nativeValidatePaymentDetails(ByteBuffer buffer
); | 24 private static native boolean nativeValidatePaymentDetails(ByteBuffer buffer
); |
25 }; | 25 }; |
OLD | NEW |