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

Unified Diff: chrome/browser/android/vr_shell/vr_core_info.cc

Issue 2865463003: Tracks GVR version crossed with headset type using UMA. (Closed)
Patch Set: Incorporated review feedback Created 3 years, 7 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: chrome/browser/android/vr_shell/vr_core_info.cc
diff --git a/chrome/browser/android/vr_shell/vr_core_info.cc b/chrome/browser/android/vr_shell/vr_core_info.cc
new file mode 100644
index 0000000000000000000000000000000000000000..673b391ad3f4df680c6f85771849f7a7c130694d
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_core_info.cc
@@ -0,0 +1,40 @@
+// 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.
+
+#include "chrome/browser/android/vr_shell/vr_core_info.h"
+
+#include "base/android/jni_android.h"
+#include "jni/VrCoreInfo_jni.h"
+
+using base::android::JavaParamRef;
+
+namespace vr_shell {
+
+VrCoreInfo::VrCoreInfo(int32_t major_version,
+ int32_t minor_version,
+ int32_t patch_version,
+ VrCoreCompatibility compatibility)
+ : gvr_version({major_version, minor_version, patch_version}),
+ compatibility(compatibility) {}
+
+// ----------------------------------------------------------------------------
+// Native JNI methods
+// ----------------------------------------------------------------------------
+
+bool RegisterVrCoreInfo(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+jlong Init(JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ jint major_version,
+ jint minor_version,
+ jint patch_version,
+ jint compatibility) {
+ return reinterpret_cast<intptr_t>(
+ new VrCoreInfo(major_version, minor_version, patch_version,
+ static_cast<VrCoreCompatibility>(compatibility)));
+}
+
+} // namespace vr_shell

Powered by Google App Engine
This is Rietveld 408576698