OLD | NEW |
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_provider.h" | 5 #include "ui/events/gesture_detection/gesture_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 const gfx::PointF center = bounds.CenterPoint(); | 61 const gfx::PointF center = bounds.CenterPoint(); |
62 return gfx::RectF( | 62 return gfx::RectF( |
63 center.x() - width / 2.f, center.y() - height / 2.f, width, height); | 63 center.x() - width / 2.f, center.y() - height / 2.f, width, height); |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 // GestureProvider:::Config | 68 // GestureProvider:::Config |
69 | 69 |
70 GestureProvider::Config::Config() | 70 GestureProvider::Config::Config() |
71 : display(gfx::Display::kInvalidDisplayID, gfx::Rect(1, 1)), | 71 : display(display::Display::kInvalidDisplayID, gfx::Rect(1, 1)), |
72 double_tap_support_for_platform_enabled(true), | 72 double_tap_support_for_platform_enabled(true), |
73 gesture_begin_end_types_enabled(false), | 73 gesture_begin_end_types_enabled(false), |
74 min_gesture_bounds_length(0), | 74 min_gesture_bounds_length(0), |
75 max_gesture_bounds_length(0) { | 75 max_gesture_bounds_length(0) {} |
76 } | |
77 | 76 |
78 GestureProvider::Config::Config(const Config& other) = default; | 77 GestureProvider::Config::Config(const Config& other) = default; |
79 | 78 |
80 GestureProvider::Config::~Config() { | 79 GestureProvider::Config::~Config() { |
81 } | 80 } |
82 | 81 |
83 // GestureProvider::GestureListener | 82 // GestureProvider::GestureListener |
84 | 83 |
85 class GestureProvider::GestureListenerImpl : public ScaleGestureListener, | 84 class GestureProvider::GestureListenerImpl : public ScaleGestureListener, |
86 public GestureListener, | 85 public GestureListener, |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 // null'ing of the listener until the sequence has ended. | 830 // null'ing of the listener until the sequence has ended. |
832 if (current_down_event_) | 831 if (current_down_event_) |
833 return; | 832 return; |
834 | 833 |
835 const bool double_tap_enabled = | 834 const bool double_tap_enabled = |
836 double_tap_support_for_page_ && double_tap_support_for_platform_; | 835 double_tap_support_for_page_ && double_tap_support_for_platform_; |
837 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 836 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
838 } | 837 } |
839 | 838 |
840 } // namespace ui | 839 } // namespace ui |
OLD | NEW |