| 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 #ifndef COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_PAYMENTS_ANDROID_JOURNEY_LOGGER_ANDROID_H_ |
| 6 #define COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_ | 6 #define CHROME_BROWSER_PAYMENTS_ANDROID_JOURNEY_LOGGER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "components/payments/core/journey_logger.h" | 12 #include "components/payments/core/journey_logger.h" |
| 13 | 13 |
| 14 namespace payments { | 14 namespace payments { |
| 15 | 15 |
| 16 // Forwarding calls to payments::JourneyLogger. | 16 // Forwarding calls to payments::JourneyLogger. |
| 17 class JourneyLoggerAndroid { | 17 class JourneyLoggerAndroid { |
| 18 public: | 18 public: |
| 19 // Registers the JNI bindings for this class. | 19 // Registers the JNI bindings for this class. |
| 20 static bool Register(JNIEnv* env); | 20 static bool Register(JNIEnv* env); |
| 21 | 21 |
| 22 explicit JourneyLoggerAndroid(bool is_incognito); | 22 JourneyLoggerAndroid(bool is_incognito, const std::string& url); |
| 23 ~JourneyLoggerAndroid(); | 23 ~JourneyLoggerAndroid(); |
| 24 | 24 |
| 25 // Message from Java to destroy this object. | 25 // Message from Java to destroy this object. |
| 26 void Destroy(JNIEnv* env, | 26 void Destroy(JNIEnv* env, |
| 27 const base::android::JavaParamRef<jobject>& jcaller); | 27 const base::android::JavaParamRef<jobject>& jcaller); |
| 28 | 28 |
| 29 void SetNumberOfSuggestionsShown( | 29 void SetNumberOfSuggestionsShown( |
| 30 JNIEnv* env, | 30 JNIEnv* env, |
| 31 const base::android::JavaParamRef<jobject>& jcaller, | 31 const base::android::JavaParamRef<jobject>& jcaller, |
| 32 jint jsection, | 32 jint jsection, |
| 33 jint jnumber); | 33 jint jnumber); |
| 34 void IncrementSelectionChanges( | 34 void IncrementSelectionChanges( |
| 35 JNIEnv* env, | 35 JNIEnv* env, |
| 36 const base::android::JavaParamRef<jobject>& jcaller, | 36 const base::android::JavaParamRef<jobject>& jcaller, |
| 37 jint jsection); | 37 jint jsection); |
| 38 void IncrementSelectionEdits( | 38 void IncrementSelectionEdits( |
| 39 JNIEnv* env, | 39 JNIEnv* env, |
| 40 const base::android::JavaParamRef<jobject>& jcaller, | 40 const base::android::JavaParamRef<jobject>& jcaller, |
| 41 jint jsection); | 41 jint jsection); |
| 42 void IncrementSelectionAdds( | 42 void IncrementSelectionAdds( |
| 43 JNIEnv* env, | 43 JNIEnv* env, |
| 44 const base::android::JavaParamRef<jobject>& jcaller, | 44 const base::android::JavaParamRef<jobject>& jcaller, |
| 45 jint jsection); | 45 jint jsection); |
| 46 void SetCanMakePaymentValue( | 46 void SetCanMakePaymentValue( |
| 47 JNIEnv* env, | 47 JNIEnv* env, |
| 48 const base::android::JavaParamRef<jobject>& jcaller, | 48 const base::android::JavaParamRef<jobject>& jcaller, |
| 49 jboolean jvalue); | 49 jboolean jvalue); |
| 50 void SetShowCalled(JNIEnv* env, | 50 void SetShowCalled(JNIEnv* env, |
| 51 const base::android::JavaParamRef<jobject>& jcaller); | 51 const base::android::JavaParamRef<jobject>& jcaller); |
| 52 void SetEventOccurred(JNIEnv* env, |
| 53 const base::android::JavaParamRef<jobject>& jcaller, |
| 54 jint jevent); |
| 52 void RecordJourneyStatsHistograms( | 55 void RecordJourneyStatsHistograms( |
| 53 JNIEnv* env, | 56 JNIEnv* env, |
| 54 const base::android::JavaParamRef<jobject>& jcaller, | 57 const base::android::JavaParamRef<jobject>& jcaller, |
| 55 jint jcompletion_status); | 58 jint jcompletion_status); |
| 56 | 59 |
| 57 private: | 60 private: |
| 58 JourneyLogger journey_logger_; | 61 JourneyLogger journey_logger_; |
| 59 | 62 |
| 60 DISALLOW_COPY_AND_ASSIGN(JourneyLoggerAndroid); | 63 DISALLOW_COPY_AND_ASSIGN(JourneyLoggerAndroid); |
| 61 }; | 64 }; |
| 62 | 65 |
| 63 } // namespace payments | 66 } // namespace payments |
| 64 | 67 |
| 65 #endif // COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_ | 68 #endif // CHROME_BROWSER_PAYMENTS_ANDROID_JOURNEY_LOGGER_ANDROID_H_ |
| OLD | NEW |