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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContext.java

Issue 2417743003: Remove Interface from file names and add Impl to actual implementation (Closed)
Patch Set: nit Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContextImpl.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContext.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContext.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContext.java
index 99f30f2f4319158454164eab9493e699b596329c..26f5e00d1cf7d14213811f4763eeba8b3feb4e9c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContext.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContext.java
@@ -4,54 +4,28 @@
package org.chromium.chrome.browser.vr_shell;
-import android.app.Activity;
-import android.os.StrictMode;
-
-import com.google.vr.ndk.base.GvrLayout;
-
-import org.chromium.base.Log;
-import org.chromium.base.annotations.UsedByReflection;
-
/**
- * Creates an active GvrContext from a detached GvrLayout. This is used by magic window mode.
+ * Abstracts away the NonPresentingGvrContext class, which may or may not be present at runtime
+ * depending on compile flags.
*/
-@UsedByReflection("VrShellDelegate.java")
-public class NonPresentingGvrContext implements NonPresentingGvrContextInterface {
- private static final String TAG = "NPGvrContext";
- private GvrLayout mGvrLayout;
-
- @UsedByReflection("VrShellDelegate.java")
- public NonPresentingGvrContext(Activity activity) {
- mGvrLayout = new GvrLayout(activity);
- }
-
- @Override
- public long getNativeGvrContext() {
- long nativeGvrContext = 0;
- StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
- try {
- nativeGvrContext = mGvrLayout.getGvrApi().getNativeGvrContext();
- } catch (Exception ex) {
- Log.e(TAG, "Unable to instantiate GvrApi", ex);
- return 0;
- } finally {
- StrictMode.setThreadPolicy(oldPolicy);
- }
- return nativeGvrContext;
- }
-
- @Override
- public void resume() {
- mGvrLayout.onResume();
- }
-
- @Override
- public void pause() {
- mGvrLayout.onPause();
- }
-
- @Override
- public void shutdown() {
- mGvrLayout.shutdown();
- }
+public interface NonPresentingGvrContext {
+ /**
+ * Returns the native gvr context.
+ */
+ long getNativeGvrContext();
+
+ /**
+ * Must be called when activity resumes.
+ */
+ void resume();
+
+ /**
+ * Must be called when activity pauses.
+ */
+ void pause();
+
+ /**
+ * Shutdown the native gvr context.
+ */
+ void shutdown();
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/vr_shell/NonPresentingGvrContextImpl.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698