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

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

Issue 613373004: Adopt ui::GestureConfiguration on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move DefaultGestureProviderConfig function to gesture_provider_config_helper class Created 6 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/events/gesture_detection/gesture_configuration.h"
6
7 #include "base/command_line.h"
8 #include "ui/events/event_switches.h"
9
10 namespace ui {
11 namespace {
12
13 class GESTURE_DETECTION_EXPORT GestureConfigurationAura
14 : public GestureConfiguration {
15 public:
16 static GestureConfigurationAura* GetInstance() {
17 return Singleton<GestureConfigurationAura>::get();
18 }
19
20 private:
21 GestureConfigurationAura() : GestureConfiguration() {
22 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms());
23 set_gesture_begin_end_types_enabled(true);
24 set_min_gesture_bounds_length(default_radius());
25 set_min_pinch_update_span_delta(
26 CommandLine::ForCurrentProcess()->HasSwitch(
27 switches::kCompensateForUnstablePinchZoom)
28 ? 5 : 0);
29 set_min_scaling_touch_major(default_radius() * 2);
30 set_span_slop(max_touch_move_in_pixels_for_click() * 2);
31 set_swipe_enabled(true);
32 set_two_finger_tap_enabled(true);
33 }
34 friend struct DefaultSingletonTraits<GestureConfigurationAura>;
35 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAura);
36 };
37
38 } // namespace
39
40 GestureConfiguration* GestureConfiguration::GetInstance() {
41 return GestureConfigurationAura::GetInstance();
42 }
43
44 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698