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

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

Issue 2047903002: [Chromoting] TouchInputHandler now listens to events in DesktopView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve review comments Created 4 years, 6 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 8c4e1faeec3b38900dbbc5540baea802a94fb16f..b941562708e55886136c9fd7608e437c7345e251 100644
--- a/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
+++ b/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
@@ -58,6 +58,11 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface,
private boolean mSurfaceCreated = false;
private final Event.Raisable<PaintEventParameter> mOnPaint = new Event.Raisable<>();
+ private final Event.Raisable<SizeChangedEventParameter> mOnClientSizeChanged =
+ new Event.Raisable<>();
+ private final Event.Raisable<SizeChangedEventParameter> mOnHostSizeChanged =
+ new Event.Raisable<>();
+ private final Event.Raisable<TouchEventParameter> mOnTouch = new Event.Raisable<>();
// Variables to control animation by the TouchInputHandler.
@@ -96,6 +101,18 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface,
return mOnPaint;
}
+ public Event<SizeChangedEventParameter> onClientSizeChanged() {
+ return mOnClientSizeChanged;
+ }
+
+ public Event<SizeChangedEventParameter> onHostSizeChanged() {
+ return mOnHostSizeChanged;
+ }
+
+ public Event<TouchEventParameter> onTouch() {
+ return mOnTouch;
+ }
+
/** Request repainting of the desktop view. */
void requestRepaint() {
synchronized (mRenderData) {
@@ -140,7 +157,7 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface,
}
}
if (sizeChanged) {
- mInputHandler.onHostSizeChanged(width, height);
+ mOnHostSizeChanged.raise(new SizeChangedEventParameter(width, height));
}
Canvas canvas;
@@ -223,7 +240,7 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface,
}
attachRedrawCallback();
- mInputHandler.onClientSizeChanged(width, height);
+ mOnClientSizeChanged.raise(new SizeChangedEventParameter(width, height));
requestRepaint();
}
@@ -276,7 +293,9 @@ public class DesktopView extends SurfaceView implements DesktopViewInterface,
/** Called whenever the user attempts to touch the canvas. */
@Override
public boolean onTouchEvent(MotionEvent event) {
- return mInputHandler.onTouchEvent(event);
+ TouchEventParameter parameter = new TouchEventParameter(event);
+ mOnTouch.raise(parameter);
+ return parameter.handled;
}
@Override
« no previous file with comments | « remoting/android/client_java_tmpl.gni ('k') | remoting/android/java/src/org/chromium/chromoting/DesktopViewInterface.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698