Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/input/input_router_config_helper.h" | 5 #include "content/browser/renderer_host/input/input_router_config_helper.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
| 10 #include "ui/events/gesture_detection/gesture_configuration.h" | 10 #include "ui/events/gesture_detection/gesture_configuration.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 ui::GestureConfiguration* gesture_config = | 42 ui::GestureConfiguration* gesture_config = |
| 43 ui::GestureConfiguration::GetInstance(); | 43 ui::GestureConfiguration::GetInstance(); |
| 44 config.debounce_interval = base::TimeDelta::FromMilliseconds( | 44 config.debounce_interval = base::TimeDelta::FromMilliseconds( |
| 45 gesture_config->scroll_debounce_interval_in_ms()); | 45 gesture_config->scroll_debounce_interval_in_ms()); |
| 46 | 46 |
| 47 config.touchscreen_tap_suppression_config.enabled = | 47 config.touchscreen_tap_suppression_config.enabled = |
| 48 gesture_config->fling_touchscreen_tap_suppression_enabled(); | 48 gesture_config->fling_touchscreen_tap_suppression_enabled(); |
| 49 config.touchscreen_tap_suppression_config.max_cancel_to_down_time = | 49 config.touchscreen_tap_suppression_config.max_cancel_to_down_time = |
| 50 base::TimeDelta::FromMilliseconds( | 50 base::TimeDelta::FromMilliseconds( |
| 51 gesture_config->fling_max_cancel_to_down_time_in_ms()); | 51 gesture_config->fling_max_cancel_to_down_time_in_ms()); |
| 52 // Long press must get suppressed when a tap down cancels a fling. | |
| 52 config.touchscreen_tap_suppression_config.max_tap_gap_time = | 53 config.touchscreen_tap_suppression_config.max_tap_gap_time = |
| 53 base::TimeDelta::FromMilliseconds( | 54 base::TimeDelta::FromMilliseconds( |
| 54 gesture_config->long_press_time_in_ms()); | 55 gesture_config->long_press_time_in_ms() * 1.1); |
|
tdresser
2016/12/01 18:57:59
Maybe elaborate a bit here - why does this need to
sahel
2016/12/06 15:18:13
Done.
| |
| 55 | 56 |
| 56 config.touchpad_tap_suppression_config.enabled = | 57 config.touchpad_tap_suppression_config.enabled = |
| 57 gesture_config->fling_touchpad_tap_suppression_enabled(); | 58 gesture_config->fling_touchpad_tap_suppression_enabled(); |
| 58 config.touchpad_tap_suppression_config.max_cancel_to_down_time = | 59 config.touchpad_tap_suppression_config.max_cancel_to_down_time = |
| 59 base::TimeDelta::FromMilliseconds( | 60 base::TimeDelta::FromMilliseconds( |
| 60 gesture_config->fling_max_cancel_to_down_time_in_ms()); | 61 gesture_config->fling_max_cancel_to_down_time_in_ms()); |
| 61 config.touchpad_tap_suppression_config.max_tap_gap_time = | 62 config.touchpad_tap_suppression_config.max_tap_gap_time = |
| 62 base::TimeDelta::FromMilliseconds( | 63 base::TimeDelta::FromMilliseconds( |
| 63 gesture_config->fling_max_tap_gap_time_in_ms()); | 64 gesture_config->fling_max_tap_gap_time_in_ms()); |
| 64 | 65 |
| 65 return config; | 66 return config; |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace | 69 } // namespace |
| 69 | 70 |
| 70 InputRouterImpl::Config GetInputRouterConfigForPlatform() { | 71 InputRouterImpl::Config GetInputRouterConfigForPlatform() { |
| 71 InputRouterImpl::Config config; | 72 InputRouterImpl::Config config; |
| 72 config.gesture_config = GetGestureEventQueueConfig(); | 73 config.gesture_config = GetGestureEventQueueConfig(); |
| 73 config.touch_config = GetTouchEventQueueConfig(); | 74 config.touch_config = GetTouchEventQueueConfig(); |
| 74 return config; | 75 return config; |
| 75 } | 76 } |
| 76 | 77 |
| 77 } // namespace content | 78 } // namespace content |
| OLD | NEW |