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

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

Issue 1405773004: Aura on Android: Making events work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@auraclank_upstream_idle
Patch Set: Created 5 years, 2 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
« ui/events/BUILD.gn ('K') | « ui/events/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_configuration.h" 5 #include "ui/events/gesture_detection/gesture_configuration.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "ui/gfx/android/view_configuration.h" 9 #include "ui/gfx/android/view_configuration.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
(...skipping 19 matching lines...) Expand all
30 return base::Singleton<GestureConfigurationAndroid>::get(); 30 return base::Singleton<GestureConfigurationAndroid>::get();
31 } 31 }
32 32
33 private: 33 private:
34 GestureConfigurationAndroid() : GestureConfiguration() { 34 GestureConfigurationAndroid() : GestureConfiguration() {
35 set_double_tap_enabled(true); 35 set_double_tap_enabled(true);
36 set_double_tap_timeout_in_ms(ViewConfiguration::GetDoubleTapTimeoutInMs()); 36 set_double_tap_timeout_in_ms(ViewConfiguration::GetDoubleTapTimeoutInMs());
37 // TODO(jdduke): Enable this on Android M after the implicit conflict with 37 // TODO(jdduke): Enable this on Android M after the implicit conflict with
38 // stylus selection is resolved. 38 // stylus selection is resolved.
39 set_stylus_scale_enabled(false); 39 set_stylus_scale_enabled(false);
40 #if defined(USE_AURA)
41 set_gesture_begin_end_types_enabled(true);
42 #else
40 set_gesture_begin_end_types_enabled(false); 43 set_gesture_begin_end_types_enabled(false);
44 #endif
sadrul 2015/10/15 19:54:22 Or would it make sense to actually use GestureConf
mfomitchev 2015/10/15 20:06:29 The Android implementation gets a bunch of setting
jdduke (slow) 2015/10/15 20:50:51 Sorry for the drive-by, but yeah, when we fashione
mfomitchev 2015/10/15 21:42:05 We could, sure. Isn't it preferable though to have
41 set_long_press_time_in_ms(ViewConfiguration::GetLongPressTimeoutInMs()); 45 set_long_press_time_in_ms(ViewConfiguration::GetLongPressTimeoutInMs());
42 set_max_distance_between_taps_for_double_tap( 46 set_max_distance_between_taps_for_double_tap(
43 ViewConfiguration::GetDoubleTapSlopInDips()); 47 ViewConfiguration::GetDoubleTapSlopInDips());
44 // TODO(jdduke): Set this to 2 after double-click triggers selection only in 48 // TODO(jdduke): Set this to 2 after double-click triggers selection only in
45 // editable elements, see crbug.com/522268. 49 // editable elements, see crbug.com/522268.
46 set_max_tap_count(1); 50 set_max_tap_count(1);
47 set_max_fling_velocity( 51 set_max_fling_velocity(
48 ViewConfiguration::GetMaximumFlingVelocityInDipsPerSecond()); 52 ViewConfiguration::GetMaximumFlingVelocityInDipsPerSecond());
49 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips); 53 set_max_gesture_bounds_length(kMaxGestureBoundsLengthDips);
50 set_max_touch_move_in_pixels_for_click( 54 set_max_touch_move_in_pixels_for_click(
(...skipping 21 matching lines...) Expand all
72 }; 76 };
73 77
74 } // namespace 78 } // namespace
75 79
76 // Create a GestureConfigurationAura singleton instance when using Android. 80 // Create a GestureConfigurationAura singleton instance when using Android.
77 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() { 81 GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() {
78 return GestureConfigurationAndroid::GetInstance(); 82 return GestureConfigurationAndroid::GetInstance();
79 } 83 }
80 84
81 } // namespace ui 85 } // namespace ui
OLDNEW
« ui/events/BUILD.gn ('K') | « ui/events/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698