Chromium Code Reviews| 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..0e503401311a7236528f3a5767841c9d01b51a13 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,17 @@ public class Client implements InputStub { |
| } |
| } |
| + public void setRenderStub(RenderStub stub) { |
| + Preconditions.isNull(mRenderStub); |
| + Preconditions.notNull(stub); |
| + mRenderStub = stub; |
| + } |
| + |
| + public RenderStub getRenderStub() { |
| + Preconditions.notNull(mRenderStub); |
|
joedow
2016/09/12 19:55:08
Is this precondition needed? I'm wondering if som
Yuwei
2016/09/12 22:17:58
Removed.
|
| + return mRenderStub; |
| + } |
| + |
| /** Returns the current Client instance, or null. */ |
| public static Client getInstance() { |
| return sClient; |