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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/jni/Client.java

Issue 2322623002: [Remoting Android] Refactor GlDesktopView (Closed)
Patch Set: Add RenderController Created 4 years, 3 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: remoting/android/java/src/org/chromium/chromoting/jni/Client.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/Client.java b/remoting/android/java/src/org/chromium/chromoting/jni/Client.java
index 30982cc7286e405afb890d056a8a6ec5f3638da0..4fa0b8f362d945acf58d2fa8819d459919c3ce0d 100644
--- a/remoting/android/java/src/org/chromium/chromoting/jni/Client.java
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/Client.java
@@ -4,17 +4,12 @@
package org.chromium.chromoting.jni;
-import android.content.Context;
-
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.chromoting.CapabilityManager;
-import org.chromium.chromoting.Desktop;
-import org.chromium.chromoting.DesktopView;
-import org.chromium.chromoting.DesktopViewFactory;
import org.chromium.chromoting.InputStub;
-import org.chromium.chromoting.Preconditions;
+import org.chromium.chromoting.RenderController;
import org.chromium.chromoting.SessionAuthenticator;
/**
@@ -27,10 +22,9 @@ import org.chromium.chromoting.SessionAuthenticator;
@JNINamespace("remoting")
public class Client implements InputStub {
// Pointer to the C++ object, cast to a |long|.
- private long mNativeJniClient;
+ private final long mNativeJniClient;
- // The factory to create implementation-dependent desktop view.
- private DesktopViewFactory mDesktopViewFactory;
+ private final RenderController mRenderController;
// The global Client instance (may be null). This needs to be a global singleton so that the
// Client can be passed between Activities.
@@ -43,23 +37,7 @@ public class Client implements InputStub {
sClient = this;
mNativeJniClient = nativeInit();
- }
-
- /**
- * Sets the desktop view factory to be used by {@link Client#createDesktopView(Context)}.
- * @param factory The factory to create implementation-dependent desktop view.
- */
- public void setDesktopViewFactory(DesktopViewFactory factory) {
- mDesktopViewFactory = factory;
- }
-
- /**
- * Creates an implementation specific {@link DesktopView} using the
- * {@link DesktopViewFactory} set by {@link Client#setDesktopViewFactory(DesktopViewFactory)}.
- */
- public DesktopView createDesktopView(Desktop desktop, Client client) {
- Preconditions.notNull(mDesktopViewFactory);
- return mDesktopViewFactory.createDesktopView(desktop, client);
+ mRenderController = new RenderController(this);
}
// Suppress FindBugs warning, since |sClient| is only used on the UI thread.
@@ -77,6 +55,10 @@ public class Client implements InputStub {
return sClient;
}
+ public RenderController getRenderController() {
+ return mRenderController;
+ }
+
/** Used for authentication-related UX during connection. */
private SessionAuthenticator mAuthenticator;

Powered by Google App Engine
This is Rietveld 408576698