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

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

Issue 2322623002: [Remoting Android] Refactor GlDesktopView (Closed)
Patch Set: Reviewer's Feedback 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..274d149d335d8b62d15231b2e1457e28aa9422eb 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,13 @@
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.RenderStub;
import org.chromium.chromoting.SessionAuthenticator;
/**
@@ -27,10 +23,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 RenderStub mRenderStub;
// The global Client instance (may be null). This needs to be a global singleton so that the
// Client can be passed between Activities.
@@ -45,23 +40,6 @@ public class Client implements InputStub {
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);
- }
-
// Suppress FindBugs warning, since |sClient| is only used on the UI thread.
@SuppressFBWarnings("LI_LAZY_INIT_STATIC")
public void destroy() {
@@ -72,6 +50,16 @@ public class Client implements InputStub {
}
}
+ public void setRenderStub(RenderStub stub) {
+ Preconditions.isNull(mRenderStub);
+ Preconditions.notNull(stub);
+ mRenderStub = stub;
+ }
+
+ public RenderStub getRenderStub() {
+ return mRenderStub;
+ }
+
/** Returns the current Client instance, or null. */
public static Client getInstance() {
return sClient;

Powered by Google App Engine
This is Rietveld 408576698