Commit 5813ed20 authored by Amirhossein Simjour's avatar Amirhossein Simjour Committed by Commit Bot

VR: set pointer type for gestures in VR

The touch events that are generated based on the controller state
should not have touch size. This CL sets the pointer type to stylus
to make sure that disambiguation popup won't show up in VR.

BUG=817055

Change-Id: I903c9d19f331b59cd55c7ade0f5d3e26faae672a
Reviewed-on: https://chromium-review.googlesource.com/949622Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Amirhossein Simjour <asimjour@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541434}
parent d159d656
......@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.vr_shell;
import android.view.MotionEvent;
import android.view.View;
import org.chromium.base.annotations.CalledByNative;
......@@ -31,7 +32,8 @@ public class AndroidUiGestureTarget {
@CalledByNative
private void setPointer(int x, int y) {
mMotionEventSynthesizer.setPointer(0 /* index */, x, y, 0 /* id */);
mMotionEventSynthesizer.setPointer(
0 /* index */, x, y, 0 /* id */, MotionEvent.TOOL_TYPE_STYLUS);
}
@CalledByNative
......
......@@ -35,8 +35,9 @@ public class MotionEventSynthesizer {
* @param x X coordinate of the point.
* @param x Y coordinate of the point.
* @param id Id property of the point.
* @param toolType ToolType property of the point.
*/
public void setPointer(int index, int x, int y, int id) {
public void setPointer(int index, int x, int y, int id, int toolType) {
assert (0 <= index && index < MAX_NUM_POINTERS);
PointerCoords coords = new PointerCoords();
......@@ -47,9 +48,22 @@ public class MotionEventSynthesizer {
PointerProperties properties = new PointerProperties();
properties.id = id;
properties.toolType = toolType;
mPointerProperties[index] = properties;
}
/**
* Sets the coordinate of the point at which a touch event takes place.
*
* @param index Index of the point when there are multiple points.
* @param x X coordinate of the point.
* @param x Y coordinate of the point.
* @param id Id property of the point.
*/
public void setPointer(int index, int x, int y, int id) {
setPointer(index, x, y, id, MotionEvent.TOOL_TYPE_UNKNOWN);
}
/**
* Sets the scroll delta against the origin point of a touch event.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment