Chromium Code Reviews| Index: device/vr/android/java/src/org/chromium/device/vr/GoogleVRDeviceProvider.java |
| diff --git a/device/vr/android/java/src/org/chromium/device/vr/GoogleVRDeviceProvider.java b/device/vr/android/java/src/org/chromium/device/vr/GoogleVRDeviceProvider.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5c825fad06bbd4422674dbaa806c3073ac452ae5 |
| --- /dev/null |
| +++ b/device/vr/android/java/src/org/chromium/device/vr/GoogleVRDeviceProvider.java |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
|
bshe
2016/08/08 21:43:40
2016 :)
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.device.vr; |
| + |
| +import android.content.Context; |
| + |
| +import com.google.vr.ndk.base.GvrLayout; |
| + |
| +import org.chromium.base.annotations.CalledByNative; |
| +import org.chromium.base.annotations.JNINamespace; |
| + |
| +/** |
| + * This is the implementation of the C++ counterpart GoogleVRDeviceProvider. |
| + */ |
| +@JNINamespace("device") |
| +class GoogleVRDeviceProvider { |
| + private static final String TAG = "GoogleVRDeviceProvider"; |
| + private final GvrLayout mLayout; |
| + |
| + private GoogleVRDeviceProvider(Context context) { |
| + mLayout = new GvrLayout(context); |
| + } |
| + |
| + @CalledByNative |
| + private static GoogleVRDeviceProvider create(Context context) { |
| + return new GoogleVRDeviceProvider(context); |
| + } |
| + |
| + @CalledByNative |
| + private long getNativeContext() { |
| + return mLayout.getGvrApi().getNativeGvrContext(); |
| + } |
| + |
| + @CalledByNative |
| + private void shutdown() { |
| + mLayout.shutdown(); |
| + } |
| +} |