Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java b/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java |
| index 17cc792d8ad475369c5323aa521aed07c03a1425..2d2c80733147550ad7141ed8c7c0d2eaec36d441 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java |
| @@ -59,6 +59,7 @@ public class PopupTouchHandleDrawable extends View { |
| static final int CENTER = 1; |
| static final int RIGHT = 2; |
| private int mOrientation = -1; |
| + private boolean mDownTouch = false; |
| /** |
| * Provides additional interaction behaviors necessary for handle |
| @@ -117,9 +118,28 @@ public class PopupTouchHandleDrawable extends View { |
| offsetEvent.offsetLocation(offsetX, offsetY); |
| final boolean handled = delegate.onTouchHandleEvent(offsetEvent); |
| offsetEvent.recycle(); |
| + // Listening for the down and up touch events |
| + // to enable accessibility services for a user |
| + // who cannot click touch screen. |
| + switch (event.getAction()) { |
| + case MotionEvent.ACTION_DOWN: |
| + mDownTouch = true; |
| + break; |
| + case MotionEvent.ACTION_UP: |
| + if (mDownTouch) { |
| + mDownTouch = false; |
| + performClick(); |
|
newt (away)
2014/10/20 22:20:53
This isn't how performClick() should be used. See
jdduke (slow)
2014/10/20 23:06:17
I'm not familiar (at all) with Android's accesibil
wajahat
2014/10/21 14:34:56
So going with the comments, it is ok to suppress t
|
| + } |
| + } |
| return handled; |
| } |
| + @Override |
| + public boolean performClick() { |
| + super.performClick(); |
| + return true; |
| + } |
| + |
| private void setOrientation(int orientation) { |
| assert orientation >= LEFT && orientation <= RIGHT; |
| if (mOrientation == orientation) return; |