| Index: remoting/android/java/src/org/chromium/chromoting/DesktopView.java
|
| diff --git a/remoting/android/java/src/org/chromium/chromoting/DesktopView.java b/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
|
| index 47fff9d9eda7cdc50616eb63cb7cf2915391da79..8c4e1faeec3b38900dbbc5540baea802a94fb16f 100644
|
| --- a/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
|
| +++ b/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
|
| @@ -10,7 +10,6 @@ import android.graphics.Canvas;
|
| import android.graphics.Color;
|
| import android.graphics.Paint;
|
| import android.graphics.Point;
|
| -import android.graphics.Rect;
|
| import android.os.Looper;
|
| import android.os.SystemClock;
|
| import android.text.InputType;
|
| @@ -82,21 +81,19 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface,
|
| getHolder().addCallback(this);
|
| }
|
|
|
| - public Event<PaintEventParameter> onPaint() {
|
| - return mOnPaint;
|
| - }
|
| -
|
| - public void setDesktop(Desktop desktop) {
|
| + @Override
|
| + public void init(Desktop desktop, Client client) {
|
| + Preconditions.isNull(mDesktop);
|
| + Preconditions.isNull(mClient);
|
| + Preconditions.notNull(desktop);
|
| + Preconditions.notNull(client);
|
| mDesktop = desktop;
|
| - }
|
| -
|
| - public void setClient(Client client) {
|
| mClient = client;
|
| + mInputHandler.init(desktop, client);
|
| }
|
|
|
| - /** See {@link TouchInputHandler#onSoftInputMethodVisibilityChanged} for API details. */
|
| - public void onSoftInputMethodVisibilityChanged(boolean inputMethodVisible, Rect bounds) {
|
| - mInputHandler.onSoftInputMethodVisibilityChanged(inputMethodVisible, bounds);
|
| + public Event<PaintEventParameter> onPaint() {
|
| + return mOnPaint;
|
| }
|
|
|
| /** Request repainting of the desktop view. */
|
| @@ -316,35 +313,4 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface,
|
| mInputAnimationRunning = enabled;
|
| }
|
| }
|
| -
|
| - /** Updates the current InputStrategy used by the TouchInputHandler. */
|
| - public void changeInputMode(
|
| - Desktop.InputMode inputMode, CapabilityManager.HostCapability hostTouchCapability) {
|
| - // We need both input mode and host input capabilities to select the input strategy.
|
| - if (!inputMode.isSet() || !hostTouchCapability.isSet()) {
|
| - return;
|
| - }
|
| -
|
| - switch (inputMode) {
|
| - case TRACKPAD:
|
| - mInputHandler.setInputStrategy(new TrackpadInputStrategy(mRenderData, mClient));
|
| - break;
|
| -
|
| - case TOUCH:
|
| - if (hostTouchCapability.isSupported()) {
|
| - mInputHandler.setInputStrategy(new TouchInputStrategy(mRenderData, mClient));
|
| - } else {
|
| - mInputHandler.setInputStrategy(
|
| - new SimulatedTouchInputStrategy(mRenderData, mClient, getContext()));
|
| - }
|
| - break;
|
| -
|
| - default:
|
| - // Unreachable, but required by Google Java style and findbugs.
|
| - assert false : "Unreached";
|
| - }
|
| -
|
| - // Ensure the cursor state is updated appropriately.
|
| - requestRepaint();
|
| - }
|
| }
|
|
|