Chromium Code Reviews| 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 b66b04173fbd7996ef490c2d54ebac460a35ea21..c6f427bf2f9bf3fa2af959127c40cd44eb0cbb7c 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/DesktopView.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/DesktopView.java |
| @@ -13,10 +13,8 @@ import android.graphics.Point; |
| import android.os.Looper; |
| import android.os.SystemClock; |
| import android.text.InputType; |
| -import android.util.AttributeSet; |
| import android.view.MotionEvent; |
| import android.view.SurfaceHolder; |
| -import android.view.SurfaceView; |
| import android.view.inputmethod.EditorInfo; |
| import android.view.inputmethod.InputConnection; |
| import android.view.inputmethod.InputMethodManager; |
| @@ -31,8 +29,7 @@ import org.chromium.chromoting.jni.Display; |
| * multitouch pan and zoom gestures, and collects and forwards input events. |
| */ |
| /** GUI element that holds the drawing canvas. */ |
| -public class DesktopView extends SurfaceView implements DesktopViewInterface, |
| - SurfaceHolder.Callback { |
| +public class DesktopView extends AbstractDesktopView implements SurfaceHolder.Callback { |
| /** Used to define the animation feedback shown when a user touches the screen. */ |
| public enum InputFeedbackType { NONE, SMALL_ANIMATION, LARGE_ANIMATION } |
| @@ -75,8 +72,11 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface, |
| /** Whether the TouchInputHandler has requested animation to be performed. */ |
| private boolean mInputAnimationRunning = false; |
| - public DesktopView(Context context, AttributeSet attributes) { |
| - super(context, attributes); |
| + public DesktopView(Context context, Display display) { |
|
Hzj_jie
2016/07/10 19:23:59
Since we are not using Android internal way to cre
Yuwei
2016/07/11 00:17:09
Sure
|
| + super(context); |
| + |
| + Preconditions.notNull(display); |
| + mDisplay = display; |
| // Give this view keyboard focus, allowing us to customize the soft keyboard's settings. |
| setFocusableInTouchMode(true); |
| @@ -93,14 +93,10 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface, |
| public void init(Desktop desktop, Client client) { |
| Preconditions.isNull(mDesktop); |
| Preconditions.isNull(mClient); |
| - Preconditions.isNull(mDisplay); |
| Preconditions.notNull(desktop); |
| Preconditions.notNull(client); |
| - Preconditions.notNull(client.getDisplay()); |
| - Preconditions.isTrue(client.getDisplay() instanceof Display); |
| mDesktop = desktop; |
| mClient = client; |
| - mDisplay = (Display) client.getDisplay(); |
| mInputHandler.init(desktop, new InputEventSender(client)); |
| } |