Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: components/payments/android/currency_formatter_android.h

Issue 2629883004: [Payment Request] Update the CurrencyStringFormatter to call the native impl. (Closed)
Patch Set: CurrencyStringFormatter -> CurrencyFormatter Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 namespace payments {
15
16 // Forwarding calls to payments::CurrencyFormatter.
17 class CurrencyFormatterAndroid {
18 public:
19 CurrencyFormatterAndroid(
20 JNIEnv* env,
21 jobject unused_obj,
22 const base::android::JavaParamRef<jstring>& currency_code,
23 const base::android::JavaParamRef<jstring>& currency_system,
24 const base::android::JavaParamRef<jstring>& locale_name);
25 ~CurrencyFormatterAndroid();
26
27 // Message from Java to destroy this object.
28 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
29
30 // Refer to CurrencyFormatter::Format documentation.
31 base::android::ScopedJavaLocalRef<jstring> Format(
32 JNIEnv* env,
33 const base::android::JavaParamRef<jobject>& unused_obj,
34 const base::android::JavaParamRef<jstring>& amount);
35
36 base::android::ScopedJavaLocalRef<jstring> GetFormattedCurrencyCode(
37 JNIEnv* env,
38 const base::android::JavaParamRef<jobject>& unused_obj);
39
40 // Registers the JNI bindings for this class.
41 static bool Register(JNIEnv* env);
42
43 private:
44 std::unique_ptr<CurrencyFormatter> currency_formatter_;
45
46 DISALLOW_COPY_AND_ASSIGN(CurrencyFormatterAndroid);
47 };
48
49 } // namespace payments
50
51 #endif // COMPONENTS_PAYMENTS_ANDROID_CURRENCY_FORMATTER_ANDROID_H_
OLDNEW
« no previous file with comments | « components/payments/android/BUILD.gn ('k') | components/payments/android/currency_formatter_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698