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

Unified Diff: components/payments/content/android/journey_logger_android.h

Issue 2750103005: [Payments] Move journey logger to native. (Closed)
Patch Set: Nits 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 side-by-side diff with in-line comments
Download patch
Index: components/payments/content/android/journey_logger_android.h
diff --git a/components/payments/content/android/journey_logger_android.h b/components/payments/content/android/journey_logger_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..d046b4d95c361fe809ed09013bf35a953b594e99
--- /dev/null
+++ b/components/payments/content/android/journey_logger_android.h
@@ -0,0 +1,62 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_
+#define COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_
+
+#include <jni.h>
+#include <memory>
please use gerrit instead 2017/03/24 16:31:46 Not used.
sebsg 2017/03/24 18:37:47 Done.
+
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "components/payments/core/journey_logger.h"
+
+namespace payments {
+
+// Forwarding calls to payments::JourneyLogger.
+class JourneyLoggerAndroid {
+ public:
+ JourneyLoggerAndroid(JNIEnv* env, jobject unused_obj) {}
please use gerrit instead 2017/03/24 16:31:47 1) Please don't inline constructors and destructor
sebsg 2017/03/24 18:37:46 Done.
+ ~JourneyLoggerAndroid() {}
+
+ // Message from Java to destroy this object.
+ void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
please use gerrit instead 2017/03/24 16:31:47 Please rename |obj| to |jcaller|. Also below.
sebsg 2017/03/24 18:37:47 Done.
+
+ void SetNumberOfSuggestionsShown(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jint jsection,
+ jint jnumber);
+ void IncrementSelectionChanges(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jint jsection);
+ void IncrementSelectionEdits(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jint jsection);
+ void IncrementSelectionAdds(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jint jsection);
+ void SetCanMakePaymentValue(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jboolean jvalue);
+ void SetShowCalled(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+ void RecordJourneyStatsHistograms(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ const base::android::JavaParamRef<jstring>& jcompletion_status);
+
+ // Registers the JNI bindings for this class.
+ static bool Register(JNIEnv* env);
please use gerrit instead 2017/03/24 16:31:46 Statics should be above constructor.
sebsg 2017/03/24 18:37:47 Done.
+
+ private:
+ JourneyLogger journey_logger_;
+
+ DISALLOW_COPY_AND_ASSIGN(JourneyLoggerAndroid);
+};
+
+} // namespace payments
+
+#endif // COMPONENTS_PAYMENTS_CONTENT_ANDROID_JOURNEY_LOGGER_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698