OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/vr_shell/vr_core_info.h" |
| 6 |
| 7 #include "base/android/jni_android.h" |
| 8 #include "jni/VrCoreInfo_jni.h" |
| 9 |
| 10 using base::android::JavaParamRef; |
| 11 |
| 12 namespace vr_shell { |
| 13 |
| 14 VrCoreInfo::VrCoreInfo(int32_t major_version, |
| 15 int32_t minor_version, |
| 16 int32_t patch_version, |
| 17 VrCoreCompatibility compatibility) |
| 18 : gvr_sdk_version({major_version, minor_version, patch_version}), |
| 19 compatibility(compatibility) {} |
| 20 |
| 21 // ---------------------------------------------------------------------------- |
| 22 // Native JNI methods |
| 23 // ---------------------------------------------------------------------------- |
| 24 |
| 25 bool RegisterVrCoreInfo(JNIEnv* env) { |
| 26 return RegisterNativesImpl(env); |
| 27 } |
| 28 |
| 29 jlong Init(JNIEnv* env, |
| 30 const JavaParamRef<jobject>& obj, |
| 31 jint major_version, |
| 32 jint minor_version, |
| 33 jint patch_version, |
| 34 jint compatibility) { |
| 35 return reinterpret_cast<intptr_t>( |
| 36 new VrCoreInfo(major_version, minor_version, patch_version, |
| 37 static_cast<VrCoreCompatibility>(compatibility))); |
| 38 } |
| 39 |
| 40 } // namespace vr_shell |
OLD | NEW |