OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 #ifndef COMPONENTS_PAYMENTS_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ | |
6 #define COMPONENTS_PAYMENTS_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/android/scoped_java_ref.h" | |
11 #include "base/macros.h" | |
12 #include "components/payments/currency_formatter.h" | |
13 | |
14 using base::android::JavaParamRef; | |
please use gerrit instead
2017/01/13 21:16:25
"using" should not be in header files, as a rule o
Mathieu
2017/01/13 22:27:01
Done.
| |
15 | |
16 namespace payments { | |
17 | |
18 // Forwarding calls to payments::CurrencyFormatter. | |
19 class CurrencyFormatterAndroid { | |
20 public: | |
21 CurrencyFormatterAndroid(JNIEnv* env, | |
22 jobject unused_obj, | |
23 const JavaParamRef<jstring>& currency_code, | |
24 const JavaParamRef<jstring>& currency_system, | |
25 const JavaParamRef<jstring>& locale_name); | |
26 ~CurrencyFormatterAndroid(); | |
27 | |
28 // Refer to CurrencyFormatter::Format documentation. | |
29 base::android::ScopedJavaLocalRef<jstring> Format( | |
30 JNIEnv* env, | |
31 const JavaParamRef<jobject>& unused_obj, | |
32 const JavaParamRef<jstring>& amount); | |
33 | |
34 // Registers the JNI bindings for this class. | |
35 static bool Register(JNIEnv* env); | |
36 | |
37 private: | |
38 std::unique_ptr<CurrencyFormatter> currency_formatter_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(CurrencyFormatterAndroid); | |
41 }; | |
42 | |
43 } // namespace payments | |
44 | |
45 #endif // COMPONENTS_PAYMENTS_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ | |
OLD | NEW |