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

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

Issue 2790253002: [Payments] Don't record CanMakePayment when in incognito mode. (Closed)
Patch Set: Addressed comments Created 3 years, 8 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 #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 {
11 namespace { 11 namespace {
12 12
13 using ::base::android::JavaParamRef; 13 using ::base::android::JavaParamRef;
14 using ::base::android::ConvertJavaStringToUTF8; 14 using ::base::android::ConvertJavaStringToUTF8;
15 15
16 } // namespace 16 } // namespace
17 17
18 // static 18 // static
19 bool JourneyLoggerAndroid::Register(JNIEnv* env) { 19 bool JourneyLoggerAndroid::Register(JNIEnv* env) {
20 return RegisterNativesImpl(env); 20 return RegisterNativesImpl(env);
21 } 21 }
22 22
23 JourneyLoggerAndroid::JourneyLoggerAndroid() {} 23 JourneyLoggerAndroid::JourneyLoggerAndroid(bool is_incognito)
24 : journey_logger_(is_incognito) {}
24 25
25 JourneyLoggerAndroid::~JourneyLoggerAndroid() {} 26 JourneyLoggerAndroid::~JourneyLoggerAndroid() {}
26 27
27 void JourneyLoggerAndroid::Destroy(JNIEnv* env, 28 void JourneyLoggerAndroid::Destroy(JNIEnv* env,
28 const JavaParamRef<jobject>& jcaller) { 29 const JavaParamRef<jobject>& jcaller) {
29 delete this; 30 delete this;
30 } 31 }
31 32
32 void JourneyLoggerAndroid::SetNumberOfSuggestionsShown( 33 void JourneyLoggerAndroid::SetNumberOfSuggestionsShown(
33 JNIEnv* env, 34 JNIEnv* env,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 const base::android::JavaParamRef<jobject>& jcaller, 89 const base::android::JavaParamRef<jobject>& jcaller,
89 jint jcompletion_status) { 90 jint jcompletion_status) {
90 DCHECK_GE(jcompletion_status, 0); 91 DCHECK_GE(jcompletion_status, 0);
91 DCHECK_LT(jcompletion_status, 92 DCHECK_LT(jcompletion_status,
92 JourneyLogger::CompletionStatus::COMPLETION_STATUS_MAX); 93 JourneyLogger::CompletionStatus::COMPLETION_STATUS_MAX);
93 journey_logger_.RecordJourneyStatsHistograms( 94 journey_logger_.RecordJourneyStatsHistograms(
94 static_cast<JourneyLogger::CompletionStatus>(jcompletion_status)); 95 static_cast<JourneyLogger::CompletionStatus>(jcompletion_status));
95 } 96 }
96 97
97 static jlong InitJourneyLoggerAndroid(JNIEnv* env, 98 static jlong InitJourneyLoggerAndroid(JNIEnv* env,
98 const JavaParamRef<jobject>& jcaller) { 99 const JavaParamRef<jobject>& jcaller,
99 return reinterpret_cast<jlong>(new JourneyLoggerAndroid()); 100 jboolean jis_incognito) {
101 return reinterpret_cast<jlong>(new JourneyLoggerAndroid(jis_incognito));
100 } 102 }
101 103
102 } // namespace payments 104 } // namespace payments
OLDNEW
« no previous file with comments | « components/payments/content/android/journey_logger_android.h ('k') | components/payments/core/journey_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698