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

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

Issue 21236002: Chromoting Android app mouse/keyboard bugfixes and enhancements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move non-negative and in-bounds input checks to C++, fix style nits Created 7 years, 5 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/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 f02dd789979cfe49db851ba8f45154ff7faa668a..48062524051b2faa22505f54deceb4f9484cc6af 100644
--- a/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
+++ b/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
@@ -85,7 +85,7 @@ public class DesktopView extends SurfaceView implements Runnable, SurfaceHolder.
getHolder().addCallback(this);
DesktopListener listener = new DesktopListener();
- mScroller = new GestureDetector(context, listener);
+ mScroller = new GestureDetector(context, listener, null, false);
mZoomer = new ScaleGestureDetector(context, listener);
mTransform = new Matrix();
@@ -179,8 +179,7 @@ public class DesktopView extends SurfaceView implements Runnable, SurfaceHolder.
// Make the right edge of the image flush with the right screen edge.
values[Matrix.MTRANS_X] += mScreenWidth - bottomright[0];
}
- }
- else {
+ } else {
// The else prevents this from being updated during the repositioning process,
// in which case the view would begin to oscillate.
mRightUsedToBeOut = rightEdgeOutOfBounds;
@@ -191,8 +190,7 @@ public class DesktopView extends SurfaceView implements Runnable, SurfaceHolder.
if (topEdgeOutOfBounds != mBottomUsedToBeOut) {
// Make the top edge of the image flush with the top screen edge.
values[Matrix.MTRANS_Y] = 0;
- }
- else {
+ } else {
// Make the bottom edge of the image flush with the bottom screen edge.
values[Matrix.MTRANS_Y] += mScreenHeight - bottomright[1];
}
@@ -314,7 +312,8 @@ public class DesktopView extends SurfaceView implements Runnable, SurfaceHolder.
if (mMouseButton == BUTTON_UNDEFINED) {
// The user pressed and released without moving: do left click and release.
Log.i("mouse", "\tStarting and finishing left click");
- handleMouseMovement(coordinates, BUTTON_LEFT, true);
+ handleMouseMovement(new float[] {coordinates[0], coordinates[1]},
+ BUTTON_LEFT, true);
mMouseButton = BUTTON_LEFT;
mMousePressed = false;
}

Powered by Google App Engine
This is Rietveld 408576698