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

Side by Side Diff: ui/events/gesture_detection/gesture_config_helper_android.cc

Issue 321563002: Support minimum gesture bounds in GestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ui/events/gesture_detection/gesture_config_helper.h" 5 #include "ui/events/gesture_detection/gesture_config_helper.h"
6 6
7 #include "ui/gfx/android/view_configuration.h" 7 #include "ui/gfx/android/view_configuration.h"
8 #include "ui/gfx/screen.h" 8 #include "ui/gfx/screen.h"
9 9
10 using gfx::ViewConfiguration; 10 using gfx::ViewConfiguration;
11 11
12 namespace ui { 12 namespace ui {
13 namespace { 13 namespace {
14 // TODO(jdduke): Adopt GestureConfiguration on Android, crbug/339203. 14 // TODO(jdduke): Adopt GestureConfiguration on Android, crbug/339203.
15 15
16 // This was the minimum tap/press size used on Android before the new gesture
17 // detection pipeline.
18 const float kMinGestureBoundsLengthDips = 24.f;
19
16 GestureDetector::Config DefaultGestureDetectorConfig( 20 GestureDetector::Config DefaultGestureDetectorConfig(
17 const gfx::Display& display) { 21 const gfx::Display& display) {
18 GestureDetector::Config config; 22 GestureDetector::Config config;
19 23
20 config.longpress_timeout = base::TimeDelta::FromMilliseconds( 24 config.longpress_timeout = base::TimeDelta::FromMilliseconds(
21 ViewConfiguration::GetLongPressTimeoutInMs()); 25 ViewConfiguration::GetLongPressTimeoutInMs());
22 config.showpress_timeout = 26 config.showpress_timeout =
23 base::TimeDelta::FromMilliseconds(ViewConfiguration::GetTapTimeoutInMs()); 27 base::TimeDelta::FromMilliseconds(ViewConfiguration::GetTapTimeoutInMs());
24 config.double_tap_timeout = base::TimeDelta::FromMilliseconds( 28 config.double_tap_timeout = base::TimeDelta::FromMilliseconds(
25 ViewConfiguration::GetDoubleTapTimeoutInMs()); 29 ViewConfiguration::GetDoubleTapTimeoutInMs());
(...skipping 29 matching lines...) Expand all
55 59
56 } // namespace 60 } // namespace
57 61
58 GestureProvider::Config DefaultGestureProviderConfig() { 62 GestureProvider::Config DefaultGestureProviderConfig() {
59 GestureProvider::Config config; 63 GestureProvider::Config config;
60 config.display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); 64 config.display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
61 config.gesture_detector_config = DefaultGestureDetectorConfig(config.display); 65 config.gesture_detector_config = DefaultGestureDetectorConfig(config.display);
62 config.scale_gesture_detector_config = 66 config.scale_gesture_detector_config =
63 DefaultScaleGestureDetectorConfig(config.display); 67 DefaultScaleGestureDetectorConfig(config.display);
64 config.gesture_begin_end_types_enabled = false; 68 config.gesture_begin_end_types_enabled = false;
69 config.min_gesture_bounds_length = kMinGestureBoundsLengthDips;
65 return config; 70 return config;
66 } 71 }
67 72
68 } // namespace ui 73 } // namespace ui
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/web_input_event_util.cc ('k') | ui/events/gesture_detection/gesture_config_helper_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698