| 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 |
| 53 // Tap suppression controller forwards the stashed tapDown and drops the rest |
| 54 // of the stashed events when the tapDownTimer expires. If a fling cancel ack |
| 55 // with |processed = false| arrives before the timer expiration, all stashed |
| 56 // events will be forwarded. The timer is used to avoid waiting for an |
| 57 // arbitrarily late fling cancel ack. Its delay should be large enough for |
| 58 // a long press to get stashed and forwarded if needed. |
| 52 config.touchscreen_tap_suppression_config.max_tap_gap_time = | 59 config.touchscreen_tap_suppression_config.max_tap_gap_time = |
| 53 base::TimeDelta::FromMilliseconds( | 60 base::TimeDelta::FromMilliseconds( |
| 54 gesture_config->long_press_time_in_ms()); | 61 gesture_config->long_press_time_in_ms() + 50); |
| 55 | 62 |
| 56 config.touchpad_tap_suppression_config.enabled = | 63 config.touchpad_tap_suppression_config.enabled = |
| 57 gesture_config->fling_touchpad_tap_suppression_enabled(); | 64 gesture_config->fling_touchpad_tap_suppression_enabled(); |
| 58 config.touchpad_tap_suppression_config.max_cancel_to_down_time = | 65 config.touchpad_tap_suppression_config.max_cancel_to_down_time = |
| 59 base::TimeDelta::FromMilliseconds( | 66 base::TimeDelta::FromMilliseconds( |
| 60 gesture_config->fling_max_cancel_to_down_time_in_ms()); | 67 gesture_config->fling_max_cancel_to_down_time_in_ms()); |
| 61 config.touchpad_tap_suppression_config.max_tap_gap_time = | 68 config.touchpad_tap_suppression_config.max_tap_gap_time = |
| 62 base::TimeDelta::FromMilliseconds( | 69 base::TimeDelta::FromMilliseconds( |
| 63 gesture_config->fling_max_tap_gap_time_in_ms()); | 70 gesture_config->fling_max_tap_gap_time_in_ms()); |
| 64 | 71 |
| 65 return config; | 72 return config; |
| 66 } | 73 } |
| 67 | 74 |
| 68 } // namespace | 75 } // namespace |
| 69 | 76 |
| 70 InputRouterImpl::Config GetInputRouterConfigForPlatform() { | 77 InputRouterImpl::Config GetInputRouterConfigForPlatform() { |
| 71 InputRouterImpl::Config config; | 78 InputRouterImpl::Config config; |
| 72 config.gesture_config = GetGestureEventQueueConfig(); | 79 config.gesture_config = GetGestureEventQueueConfig(); |
| 73 config.touch_config = GetTouchEventQueueConfig(); | 80 config.touch_config = GetTouchEventQueueConfig(); |
| 74 return config; | 81 return config; |
| 75 } | 82 } |
| 76 | 83 |
| 77 } // namespace content | 84 } // namespace content |
| OLD | NEW |