Skip to content

Commit

Permalink
CVC tap clicking now tracks all taps
Browse files Browse the repository at this point in the history
Made this track both long press and normal taps as we needed the touch event target for both.

BUG=375379

Review URL: https://codereview.chromium.org/331943004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277539 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dtrainor@chromium.org committed Jun 16, 2014
1 parent ad3eec2 commit e24d14f
Showing 1 changed file with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ public interface SmartClipDataListener {
// because the OSK was just brought up.
private final Rect mFocusPreOSKViewportRect = new Rect();

// On single tap this will store the x, y coordinates of the touch.
private int mSingleTapX;
private int mSingleTapY;
// On tap this will store the x, y coordinates of the touch.
private int mLastTapX;
private int mLastTapY;

// Whether a touch scroll sequence is active, used to hide text selection
// handles. Note that a scroll sequence will *always* bound a pinch
Expand Down Expand Up @@ -1830,33 +1830,46 @@ private void updateForTapOrPress(int type, float xPix, float yPix) {

if (!mPopupZoomer.isShowing()) mPopupZoomer.setLastTouch(xPix, yPix);

mLastTapX = (int) xPix;
mLastTapY = (int) yPix;

if (type == GestureEventType.LONG_PRESS
|| type == GestureEventType.LONG_TAP) {
getInsertionHandleController().allowAutomaticShowing();
getSelectionHandleController().allowAutomaticShowing();
} else {
setClickXAndY((int) xPix, (int) yPix);
if (mSelectionEditable) getInsertionHandleController().allowAutomaticShowing();
}
}

private void setClickXAndY(int x, int y) {
mSingleTapX = x;
mSingleTapY = y;
/**
* @return The x coordinate for the last point that a tap or press gesture was initiated from.
*/
public int getLastTapX() {
return mLastTapX;
}

/**
* @return The y coordinate for the last point that a tap or press gesture was initiated from.
*/
public int getLastTapY() {
return mLastTapY;
}

/**
* @return The x coordinate for the last point that a singleTap gesture was initiated from.
* TODO(dtrainor): Remove this once it is no longer used.
* See {@link #getLastTapX}.
*/
public int getSingleTapX() {
return mSingleTapX;
public int getSingleTapX() {
return mLastTapX;
}

/**
* @return The y coordinate for the last point that a singleTap gesture was initiated from.
* TODO(dtrainor): Remove this once it is no longer used.
* See {@link #getLastTapY}.
*/
public int getSingleTapY() {
return mSingleTapY;
public int getSingleTapY() {
return mLastTapY;
}

public void setZoomControlsDelegate(ZoomControlsDelegate zoomControlsDelegate) {
Expand Down

0 comments on commit e24d14f

Please sign in to comment.