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

Issue 95153002: Make touch-based synthetic gesture take touch slop into account. (Closed)

Created:
7 years ago by Dominik Grewe
Modified:
7 years ago
Reviewers:
jdduke (slow), bulach
CC:
chromium-reviews, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, James Su, miu+watch_chromium.org
Visibility:
Public.

Description

Make touch-based synthetic gesture take touch slop into account. Touchscreen devices typically have a 'touch slop', i.e. a certain distance a pointer has to move before it is considered moving. The touch slop is subtracted from the distance a pointer moves. So if the touch slop is 10 pixels and a pointer moves by 100 pixels on the screen, the resulting move is registered as having covered only 90 pixels. This patch adds the 'GetTouchSlopInDips' to SyntheticGestureTargets. This value is used by the gestures to increase the distances covered by touch pointers. For example, to scroll 100 pixels with a touch slop of 10 pixels, the pointer will cover 110 pixels. Touch-based synthetic gestures are updated to take the touch slop into account. BUG=313645 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=238248

Patch Set 1 #

Patch Set 2 : Fix touch slop direction. #

Patch Set 3 : Re-upload #

Patch Set 4 : Minor refactoring of pinch gesture. #

Total comments: 4

Patch Set 5 : undo pinch refactoring; get device scale factor from gfx::Screen #

Total comments: 8

Patch Set 6 : Nits #

Patch Set 7 : Fix 0 distance case & add unit tests. #

Total comments: 6

Patch Set 8 : bulach's comments. #

Patch Set 9 : Update comment. #

Patch Set 10 : Remove unused variable. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -44 lines) Patch
M content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc View 1 2 3 4 5 6 6 chunks +54 lines, -8 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target_android.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target_android.cc View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target_aura.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target_aura.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target_base.h View 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target_base.cc View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_pinch_gesture.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_pinch_gesture.cc View 1 2 3 4 5 6 7 8 9 3 chunks +33 lines, -28 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h View 2 chunks +7 lines, -6 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc View 1 2 3 4 5 6 1 chunk +5 lines, -1 line 0 comments Download
M content/common/android/view_configuration.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M content/common/android/view_configuration.cc View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Dominik Grewe
PTAL, thanks! https://codereview.chromium.org/95153002/diff/80001/content/common/android/view_configuration.cc File content/common/android/view_configuration.cc (right): https://codereview.chromium.org/95153002/diff/80001/content/common/android/view_configuration.cc#newcode57 content/common/android/view_configuration.cc:57: return Java_ViewConfiguration_getTouchSlop(env); This method is actually deprecated ...
7 years ago (2013-12-02 12:03:35 UTC) #1
jdduke (slow)
Can you separate out the pinch gesture refactoring into a separate patch? Thanks.
7 years ago (2013-12-02 15:35:32 UTC) #2
jdduke (slow)
https://codereview.chromium.org/95153002/diff/80001/content/browser/renderer_host/input/synthetic_gesture_target_android.cc File content/browser/renderer_host/input/synthetic_gesture_target_android.cc (right): https://codereview.chromium.org/95153002/diff/80001/content/browser/renderer_host/input/synthetic_gesture_target_android.cc#newcode94 content/browser/renderer_host/input/synthetic_gesture_target_android.cc:94: ViewConfiguration::GetTouchSlopInPixels() / view->GetDeviceScaleFactor(); You can use the following to ...
7 years ago (2013-12-02 15:51:39 UTC) #3
Dominik Grewe
Done. PTAL. https://codereview.chromium.org/95153002/diff/80001/content/browser/renderer_host/input/synthetic_gesture_target_android.cc File content/browser/renderer_host/input/synthetic_gesture_target_android.cc (right): https://codereview.chromium.org/95153002/diff/80001/content/browser/renderer_host/input/synthetic_gesture_target_android.cc#newcode94 content/browser/renderer_host/input/synthetic_gesture_target_android.cc:94: ViewConfiguration::GetTouchSlopInPixels() / view->GetDeviceScaleFactor(); On 2013/12/02 15:51:40, jdduke ...
7 years ago (2013-12-02 16:18:53 UTC) #4
jdduke (slow)
lgtm with nits. https://codereview.chromium.org/95153002/diff/100001/content/browser/renderer_host/input/synthetic_gesture_target_android.cc File content/browser/renderer_host/input/synthetic_gesture_target_android.cc (right): https://codereview.chromium.org/95153002/diff/100001/content/browser/renderer_host/input/synthetic_gesture_target_android.cc#newcode89 content/browser/renderer_host/input/synthetic_gesture_target_android.cc:89: return Nit: I think this can ...
7 years ago (2013-12-02 16:29:42 UTC) #5
Dominik Grewe
Thanks Jared! Adding bulach as owner for content/common/android/ https://codereview.chromium.org/95153002/diff/100001/content/browser/renderer_host/input/synthetic_gesture_target_android.cc File content/browser/renderer_host/input/synthetic_gesture_target_android.cc (right): https://codereview.chromium.org/95153002/diff/100001/content/browser/renderer_host/input/synthetic_gesture_target_android.cc#newcode89 content/browser/renderer_host/input/synthetic_gesture_target_android.cc:89: return ...
7 years ago (2013-12-02 16:42:25 UTC) #6
Dominik Grewe
Just noticed a problem with pinch when total_num_pixels_covered = 0. Because we add a touch ...
7 years ago (2013-12-02 17:17:52 UTC) #7
Dominik Grewe
+bulach
7 years ago (2013-12-02 17:36:36 UTC) #8
bulach
lgtm, thanks! just nits below: https://codereview.chromium.org/95153002/diff/140001/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc File content/browser/renderer_host/input/synthetic_gesture_target_aura.cc (right): https://codereview.chromium.org/95153002/diff/140001/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc#newcode75 content/browser/renderer_host/input/synthetic_gesture_target_aura.cc:75: return ui::GestureConfiguration::max_touch_move_in_pixels_for_click(); is this ...
7 years ago (2013-12-02 18:24:50 UTC) #9
Dominik Grewe
Thanks Marcus! https://codereview.chromium.org/95153002/diff/140001/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc File content/browser/renderer_host/input/synthetic_gesture_target_aura.cc (right): https://codereview.chromium.org/95153002/diff/140001/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc#newcode75 content/browser/renderer_host/input/synthetic_gesture_target_aura.cc:75: return ui::GestureConfiguration::max_touch_move_in_pixels_for_click(); On 2013/12/02 18:24:51, bulach wrote: ...
7 years ago (2013-12-02 18:50:03 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dominikg@chromium.org/95153002/170001
7 years ago (2013-12-02 19:20:34 UTC) #11
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) base_unittests, browser_tests, interactive_ui_tests, net_unittests, unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=195375
7 years ago (2013-12-02 19:45:22 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dominikg@chromium.org/95153002/190001
7 years ago (2013-12-02 21:24:13 UTC) #13
commit-bot: I haz the power
7 years ago (2013-12-03 00:42:10 UTC) #14
Message was sent while issue was closed.
Change committed as 238248

Powered by Google App Engine
This is Rietveld 408576698