| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #include "components/payments/android/currency_formatter_android.h" | 5 #include "components/payments/content/android/currency_formatter_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "base/optional.h" | |
| 9 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 10 #include "components/payments/currency_formatter.h" | 9 #include "components/payments/core/currency_formatter.h" |
| 11 #include "jni/CurrencyFormatter_jni.h" | 10 #include "jni/CurrencyFormatter_jni.h" |
| 12 | 11 |
| 13 using base::android::JavaParamRef; | 12 namespace payments { |
| 14 using base::android::ConvertJavaStringToUTF8; | 13 namespace { |
| 15 | 14 |
| 16 namespace payments { | 15 using ::base::android::JavaParamRef; |
| 16 using ::base::android::ConvertJavaStringToUTF8; |
| 17 |
| 18 } // namespace |
| 17 | 19 |
| 18 CurrencyFormatterAndroid::CurrencyFormatterAndroid( | 20 CurrencyFormatterAndroid::CurrencyFormatterAndroid( |
| 19 JNIEnv* env, | 21 JNIEnv* env, |
| 20 jobject unused_obj, | 22 jobject unused_obj, |
| 21 const JavaParamRef<jstring>& currency_code, | 23 const JavaParamRef<jstring>& currency_code, |
| 22 const JavaParamRef<jstring>& currency_system, | 24 const JavaParamRef<jstring>& currency_system, |
| 23 const JavaParamRef<jstring>& locale_name) { | 25 const JavaParamRef<jstring>& locale_name) { |
| 24 std::string currency_system_str = | 26 std::string currency_system_str = |
| 25 ConvertJavaStringToUTF8(env, currency_system); | 27 ConvertJavaStringToUTF8(env, currency_system); |
| 26 | 28 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const JavaParamRef<jstring>& currency_code, | 66 const JavaParamRef<jstring>& currency_code, |
| 65 const JavaParamRef<jstring>& currency_system, | 67 const JavaParamRef<jstring>& currency_system, |
| 66 const JavaParamRef<jstring>& locale_name) { | 68 const JavaParamRef<jstring>& locale_name) { |
| 67 CurrencyFormatterAndroid* currency_formatter_android = | 69 CurrencyFormatterAndroid* currency_formatter_android = |
| 68 new CurrencyFormatterAndroid(env, obj, currency_code, currency_system, | 70 new CurrencyFormatterAndroid(env, obj, currency_code, currency_system, |
| 69 locale_name); | 71 locale_name); |
| 70 return reinterpret_cast<intptr_t>(currency_formatter_android); | 72 return reinterpret_cast<intptr_t>(currency_formatter_android); |
| 71 } | 73 } |
| 72 | 74 |
| 73 } // namespace payments | 75 } // namespace payments |
| OLD | NEW |