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 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ |
6 #define UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 | 24 |
25 // Provides gesture detection and dispatch given a sequence of touch events | 25 // Provides gesture detection and dispatch given a sequence of touch events |
26 // and touch event acks. | 26 // and touch event acks. |
27 class EVENTS_EXPORT GestureProviderAura : public GestureProviderClient { | 27 class EVENTS_EXPORT GestureProviderAura : public GestureProviderClient { |
28 public: | 28 public: |
29 GestureProviderAura(GestureProviderAuraClient* client); | 29 GestureProviderAura(GestureProviderAuraClient* client); |
30 ~GestureProviderAura() override; | 30 ~GestureProviderAura() override; |
31 | 31 |
32 bool OnTouchEvent(TouchEvent* event); | 32 bool OnTouchEvent(TouchEvent* event); |
33 void OnAsyncTouchEventAck(bool event_consumed); | 33 void OnAsyncTouchEventAck(bool event_consumed); |
34 void OnSyncTouchEventAck(const uint64 unique_event_id, bool event_consumed); | 34 void OnSyncTouchEventAck(const uint64 unique_touch_event_id, |
jdduke (slow)
2015/04/09 15:40:35
I don't think we need the "touch_" addition here.
| |
35 bool event_consumed); | |
35 const MotionEventAura& pointer_state() { return pointer_state_; } | 36 const MotionEventAura& pointer_state() { return pointer_state_; } |
36 ScopedVector<GestureEvent>* GetAndResetPendingGestures(); | 37 ScopedVector<GestureEvent>* GetAndResetPendingGestures(); |
37 | 38 |
38 // GestureProviderClient implementation | 39 // GestureProviderClient implementation |
39 void OnGestureEvent(const GestureEventData& gesture) override; | 40 void OnGestureEvent(const GestureEventData& gesture) override; |
40 | 41 |
41 private: | 42 private: |
42 bool IsConsideredDoubleTap(const GestureEventData& previous_tap, | 43 bool IsConsideredDoubleTap(const GestureEventData& previous_tap, |
43 const GestureEventData& current_tap) const; | 44 const GestureEventData& current_tap) const; |
44 | 45 |
45 scoped_ptr<GestureEventData> previous_tap_; | 46 scoped_ptr<GestureEventData> previous_tap_; |
46 | 47 |
47 GestureProviderAuraClient* client_; | 48 GestureProviderAuraClient* client_; |
48 MotionEventAura pointer_state_; | 49 MotionEventAura pointer_state_; |
49 FilteredGestureProvider filtered_gesture_provider_; | 50 FilteredGestureProvider filtered_gesture_provider_; |
50 | 51 |
51 ui::LatencyInfo last_touch_event_latency_info_; | 52 ui::LatencyInfo last_touch_event_latency_info_; |
52 bool handling_event_; | 53 bool handling_event_; |
53 ScopedVector<GestureEvent> pending_gestures_; | 54 ScopedVector<GestureEvent> pending_gestures_; |
54 uint64 last_unique_touch_event_id_; | 55 uint64 last_unique_touch_event_id_; |
55 | 56 |
56 DISALLOW_COPY_AND_ASSIGN(GestureProviderAura); | 57 DISALLOW_COPY_AND_ASSIGN(GestureProviderAura); |
57 }; | 58 }; |
58 | 59 |
59 } // namespace ui | 60 } // namespace ui |
60 | 61 |
61 #endif // UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ | 62 #endif // UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ |
OLD | NEW |