| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mojo/init/ui_init.h" | 5 #include "ui/mojo/init/ui_init.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/mojo/init/screen_mojo.h" | 10 #include "ui/mojo/init/screen_mojo.h" |
| 11 | 11 |
| 12 #if defined(OS_ANDROID) | 12 #if defined(OS_ANDROID) |
| 13 #include "ui/events/gesture_detection/gesture_configuration.h" // nogncheck | 13 #include "ui/events/gesture_detection/gesture_configuration.h" // nogncheck |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 namespace mojo { | 17 namespace mojo { |
| 18 | 18 |
| 19 #if defined(OS_ANDROID) | 19 #if defined(OS_ANDROID) |
| 20 // TODO(sky): this needs to come from system. | 20 // TODO(sky): this needs to come from system. |
| 21 class GestureConfigurationMojo : public ui::GestureConfiguration { | 21 class GestureConfigurationMojo : public ui::GestureConfiguration { |
| 22 public: | 22 public: |
| 23 GestureConfigurationMojo() : GestureConfiguration() { | 23 GestureConfigurationMojo() : GestureConfiguration() { |
| 24 set_double_tap_enabled(false); | 24 set_double_tap_enabled(false); |
| 25 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms()); | 25 set_double_tap_timeout_in_ms(semi_long_press_time_in_ms()); |
| 26 set_gesture_begin_end_types_enabled(true); | 26 set_gesture_begin_end_types_enabled(true); |
| 27 set_min_gesture_bounds_length(default_radius()); | 27 set_min_gesture_bounds_length(default_radius()); |
| 28 set_min_pinch_update_span_delta(0); | 28 set_min_pinch_update_span_delta(0); |
| 29 set_min_scaling_touch_major(default_radius() * 2); | |
| 30 set_velocity_tracker_strategy( | 29 set_velocity_tracker_strategy( |
| 31 ui::VelocityTracker::Strategy::LSQ2_RESTRICTED); | 30 ui::VelocityTracker::Strategy::LSQ2_RESTRICTED); |
| 32 set_span_slop(max_touch_move_in_pixels_for_click() * 2); | 31 set_span_slop(max_touch_move_in_pixels_for_click() * 2); |
| 33 set_swipe_enabled(true); | 32 set_swipe_enabled(true); |
| 34 set_two_finger_tap_enabled(true); | 33 set_two_finger_tap_enabled(true); |
| 35 } | 34 } |
| 36 | 35 |
| 37 ~GestureConfigurationMojo() override {} | 36 ~GestureConfigurationMojo() override {} |
| 38 | 37 |
| 39 private: | 38 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 52 | 51 |
| 53 UIInit::~UIInit() { | 52 UIInit::~UIInit() { |
| 54 gfx::Screen::SetScreenInstance(nullptr); | 53 gfx::Screen::SetScreenInstance(nullptr); |
| 55 #if defined(OS_ANDROID) | 54 #if defined(OS_ANDROID) |
| 56 ui::GestureConfiguration::SetInstance(nullptr); | 55 ui::GestureConfiguration::SetInstance(nullptr); |
| 57 #endif | 56 #endif |
| 58 } | 57 } |
| 59 | 58 |
| 60 } // namespace mojo | 59 } // namespace mojo |
| 61 } // namespace ui | 60 } // namespace ui |
| OLD | NEW |