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

Side by Side Diff: components/payments/content/android/journey_logger_android.h

Issue 2750103005: [Payments] Move journey logger to native. (Closed)
Patch Set: Addressed Rouslan's comments Created 3 years, 9 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
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 #ifndef COMPONENTS_PAYMENTS_CONTENT_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ 5 #ifndef COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_
6 #define COMPONENTS_PAYMENTS_CONTENT_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ 6 #define COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <memory>
10 9
11 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
12 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "components/payments/core/journey_logger.h"
13 13
14 namespace payments { 14 namespace payments {
15 15
16 class CurrencyFormatter; 16 // Forwarding calls to payments::JourneyLogger.
17 17 class JourneyLoggerAndroid {
18 // Forwarding calls to payments::CurrencyFormatter.
19 class CurrencyFormatterAndroid {
20 public: 18 public:
21 CurrencyFormatterAndroid( 19 JourneyLoggerAndroid();
22 JNIEnv* env, 20 ~JourneyLoggerAndroid();
23 jobject unused_obj,
24 const base::android::JavaParamRef<jstring>& currency_code,
25 const base::android::JavaParamRef<jstring>& currency_system,
26 const base::android::JavaParamRef<jstring>& locale_name);
27 ~CurrencyFormatterAndroid();
28 21
29 // Message from Java to destroy this object. 22 // Message from Java to destroy this object.
30 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 23 void Destroy(JNIEnv* env,
24 const base::android::JavaParamRef<jobject>& jcaller);
31 25
32 // Refer to CurrencyFormatter::Format documentation. 26 void SetNumberOfSuggestionsShown(
33 base::android::ScopedJavaLocalRef<jstring> Format(
34 JNIEnv* env, 27 JNIEnv* env,
35 const base::android::JavaParamRef<jobject>& unused_obj, 28 const base::android::JavaParamRef<jobject>& jcaller,
36 const base::android::JavaParamRef<jstring>& amount); 29 jint jsection,
37 30 jint jnumber);
38 base::android::ScopedJavaLocalRef<jstring> GetFormattedCurrencyCode( 31 void IncrementSelectionChanges(
39 JNIEnv* env, 32 JNIEnv* env,
40 const base::android::JavaParamRef<jobject>& unused_obj); 33 const base::android::JavaParamRef<jobject>& jcaller,
34 jint jsection);
35 void IncrementSelectionEdits(
36 JNIEnv* env,
37 const base::android::JavaParamRef<jobject>& jcaller,
38 jint jsection);
39 void IncrementSelectionAdds(
40 JNIEnv* env,
41 const base::android::JavaParamRef<jobject>& jcaller,
42 jint jsection);
43 void SetCanMakePaymentValue(
44 JNIEnv* env,
45 const base::android::JavaParamRef<jobject>& jcaller,
46 jboolean jvalue);
47 void SetShowCalled(JNIEnv* env,
48 const base::android::JavaParamRef<jobject>& jcaller);
49 void RecordJourneyStatsHistograms(
50 JNIEnv* env,
51 const base::android::JavaParamRef<jobject>& jcaller,
52 jint jcompletion_status);
41 53
42 // Registers the JNI bindings for this class. 54 // Registers the JNI bindings for this class.
43 static bool Register(JNIEnv* env); 55 static bool Register(JNIEnv* env);
please use gerrit instead 2017/03/24 19:30:09 Static on top.
sebsg 2017/03/27 15:35:12 Done.
44 56
45 private: 57 private:
46 std::unique_ptr<CurrencyFormatter> currency_formatter_; 58 JourneyLogger journey_logger_;
47 59
48 DISALLOW_COPY_AND_ASSIGN(CurrencyFormatterAndroid); 60 DISALLOW_COPY_AND_ASSIGN(JourneyLoggerAndroid);
49 }; 61 };
50 62
51 } // namespace payments 63 } // namespace payments
52 64
53 #endif // COMPONENTS_PAYMENTS_CONTENT_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ 65 #endif // COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698