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

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

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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_configuration.h" 5 #include "ui/events/gesture_detection/gesture_configuration.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "ui/events/event_switches.h" 8 #include "ui/events/event_switches.h"
9 9
10 namespace ui { 10 namespace ui {
11 namespace { 11 namespace {
12 12
13 class GestureConfigurationAura : public GestureConfiguration { 13 class GestureConfigurationAura : public GestureConfiguration {
14 public: 14 public:
15 ~GestureConfigurationAura() override { 15 ~GestureConfigurationAura() override {
16 } 16 }
17 17
18 static GestureConfigurationAura* GetInstance() { 18 static GestureConfigurationAura* GetInstance() {
19 return Singleton<GestureConfigurationAura>::get(); 19 return Singleton<GestureConfigurationAura>::get();
20 } 20 }
21 21
22 private: 22 private:
23 GestureConfigurationAura() : GestureConfiguration() { 23 GestureConfigurationAura() : GestureConfiguration() {
24 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms()); 24 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms());
25 set_gesture_begin_end_types_enabled(true); 25 set_gesture_begin_end_types_enabled(true);
26 set_min_gesture_bounds_length(default_radius()); 26 set_min_gesture_bounds_length(default_radius());
27 set_min_pinch_update_span_delta( 27 set_min_pinch_update_span_delta(
28 CommandLine::ForCurrentProcess()->HasSwitch( 28 base::CommandLine::ForCurrentProcess()->HasSwitch(
29 switches::kCompensateForUnstablePinchZoom) 29 switches::kCompensateForUnstablePinchZoom)
30 ? 5 : 0); 30 ? 5
31 : 0);
31 set_min_scaling_touch_major(default_radius() * 2); 32 set_min_scaling_touch_major(default_radius() * 2);
32 set_velocity_tracker_strategy(VelocityTracker::Strategy::LSQ2_RESTRICTED); 33 set_velocity_tracker_strategy(VelocityTracker::Strategy::LSQ2_RESTRICTED);
33 set_span_slop(max_touch_move_in_pixels_for_click() * 2); 34 set_span_slop(max_touch_move_in_pixels_for_click() * 2);
34 set_swipe_enabled(true); 35 set_swipe_enabled(true);
35 set_two_finger_tap_enabled(true); 36 set_two_finger_tap_enabled(true);
36 } 37 }
37 38
38 friend struct DefaultSingletonTraits<GestureConfigurationAura>; 39 friend struct DefaultSingletonTraits<GestureConfigurationAura>;
39 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAura); 40 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationAura);
40 }; 41 };
41 42
42 } // namespace 43 } // namespace
43 44
44 // Create a GestureConfigurationAura singleton instance when using aura. 45 // Create a GestureConfigurationAura singleton instance when using aura.
45 GestureConfiguration* GestureConfiguration::GetInstance() { 46 GestureConfiguration* GestureConfiguration::GetInstance() {
46 return GestureConfigurationAura::GetInstance(); 47 return GestureConfigurationAura::GetInstance();
47 } 48 }
48 49
49 } // namespace ui 50 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/devices/x11/touch_factory_x11.cc ('k') | ui/events/ozone/evdev/touch_event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698