| 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/content/android/journey_logger_android.h" | 5 #include "components/payments/content/android/journey_logger_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "jni/JourneyLogger_jni.h" | 8 #include "jni/JourneyLogger_jni.h" |
| 9 | 9 |
| 10 namespace payments { | 10 namespace payments { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 jboolean jvalue) { | 76 jboolean jvalue) { |
| 77 journey_logger_.SetCanMakePaymentValue(jvalue); | 77 journey_logger_.SetCanMakePaymentValue(jvalue); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void JourneyLoggerAndroid::SetShowCalled( | 80 void JourneyLoggerAndroid::SetShowCalled( |
| 81 JNIEnv* env, | 81 JNIEnv* env, |
| 82 const base::android::JavaParamRef<jobject>& jcaller) { | 82 const base::android::JavaParamRef<jobject>& jcaller) { |
| 83 journey_logger_.SetShowCalled(); | 83 journey_logger_.SetShowCalled(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void JourneyLoggerAndroid::SetIsIncognito( |
| 87 JNIEnv* env, |
| 88 const base::android::JavaParamRef<jobject>& jcaller) { |
| 89 journey_logger_.SetIsIncognito(); |
| 90 } |
| 91 |
| 86 void JourneyLoggerAndroid::RecordJourneyStatsHistograms( | 92 void JourneyLoggerAndroid::RecordJourneyStatsHistograms( |
| 87 JNIEnv* env, | 93 JNIEnv* env, |
| 88 const base::android::JavaParamRef<jobject>& jcaller, | 94 const base::android::JavaParamRef<jobject>& jcaller, |
| 89 jint jcompletion_status) { | 95 jint jcompletion_status) { |
| 90 DCHECK_GE(jcompletion_status, 0); | 96 DCHECK_GE(jcompletion_status, 0); |
| 91 DCHECK_LT(jcompletion_status, | 97 DCHECK_LT(jcompletion_status, |
| 92 JourneyLogger::CompletionStatus::COMPLETION_STATUS_MAX); | 98 JourneyLogger::CompletionStatus::COMPLETION_STATUS_MAX); |
| 93 journey_logger_.RecordJourneyStatsHistograms( | 99 journey_logger_.RecordJourneyStatsHistograms( |
| 94 static_cast<JourneyLogger::CompletionStatus>(jcompletion_status)); | 100 static_cast<JourneyLogger::CompletionStatus>(jcompletion_status)); |
| 95 } | 101 } |
| 96 | 102 |
| 97 static jlong InitJourneyLoggerAndroid(JNIEnv* env, | 103 static jlong InitJourneyLoggerAndroid(JNIEnv* env, |
| 98 const JavaParamRef<jobject>& jcaller) { | 104 const JavaParamRef<jobject>& jcaller) { |
| 99 return reinterpret_cast<jlong>(new JourneyLoggerAndroid()); | 105 return reinterpret_cast<jlong>(new JourneyLoggerAndroid()); |
| 100 } | 106 } |
| 101 | 107 |
| 102 } // namespace payments | 108 } // namespace payments |
| OLD | NEW |