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 package org.chromium.chrome.browser.vr_shell; |
| 6 |
| 7 import org.chromium.base.annotations.JNINamespace; |
| 8 |
| 9 /** |
| 10 * Container class to provide the version and the compatibility with Chrome of t
he installed VrCore. |
| 11 */ |
| 12 @JNINamespace("vr_shell") |
| 13 public class VrCoreInfo { |
| 14 /** Represents the version of the installed GVR SDK. */ |
| 15 public static class GvrVersion { |
| 16 public final int majorVersion; |
| 17 public final int minorVersion; |
| 18 public final int patchVersion; |
| 19 |
| 20 public GvrVersion(int majorVersion, int minorVersion, int patchVersion)
{ |
| 21 this.majorVersion = majorVersion; |
| 22 this.minorVersion = minorVersion; |
| 23 this.patchVersion = patchVersion; |
| 24 } |
| 25 } |
| 26 |
| 27 public final GvrVersion gvrVersion; |
| 28 @VrCoreCompatibility |
| 29 public final int compatibility; |
| 30 |
| 31 public VrCoreInfo(GvrVersion gvrVersion, int compatibility) { |
| 32 this.gvrVersion = gvrVersion; |
| 33 this.compatibility = compatibility; |
| 34 } |
| 35 |
| 36 public long makeNativeVrCoreInfo() { |
| 37 return (gvrVersion == null) ? nativeInit(0, 0, 0, compatibility) |
| 38 : nativeInit(gvrVersion.majorVersion, gvrVer
sion.minorVersion, |
| 39 gvrVersion.patchVersion, compatibi
lity); |
| 40 } |
| 41 |
| 42 private native long nativeInit( |
| 43 int majorVersion, int minorVersion, int patchVersion, int compatibil
ity); |
| 44 } |
OLD | NEW |