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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 24 matching lines...) Expand all Loading... |
35 public: | 35 public: |
36 GestureProviderAura(GestureConsumer* consumer, | 36 GestureProviderAura(GestureConsumer* consumer, |
37 GestureProviderAuraClient* client); | 37 GestureProviderAuraClient* client); |
38 ~GestureProviderAura() override; | 38 ~GestureProviderAura() override; |
39 | 39 |
40 void set_gesture_consumer(GestureConsumer* consumer) { | 40 void set_gesture_consumer(GestureConsumer* consumer) { |
41 gesture_consumer_ = consumer; | 41 gesture_consumer_ = consumer; |
42 } | 42 } |
43 | 43 |
44 bool OnTouchEvent(TouchEvent* event); | 44 bool OnTouchEvent(TouchEvent* event); |
45 void OnTouchEventAck(uint32_t unique_touch_event_id, | 45 void OnTouchEventAck(uint32_t unique_touch_event_id, bool event_consumed); |
46 bool event_consumed, | |
47 bool is_source_touch_event_set_non_blocking); | |
48 const MotionEventAura& pointer_state() { return pointer_state_; } | 46 const MotionEventAura& pointer_state() { return pointer_state_; } |
49 std::vector<std::unique_ptr<GestureEvent>> GetAndResetPendingGestures(); | 47 std::vector<std::unique_ptr<GestureEvent>> GetAndResetPendingGestures(); |
50 void OnTouchEnter(int pointer_id, float x, float y); | 48 void OnTouchEnter(int pointer_id, float x, float y); |
51 | 49 |
52 // GestureProviderClient implementation | 50 // GestureProviderClient implementation |
53 void OnGestureEvent(const GestureEventData& gesture) override; | 51 void OnGestureEvent(const GestureEventData& gesture) override; |
54 | 52 |
55 private: | 53 private: |
56 GestureProviderAuraClient* client_; | 54 GestureProviderAuraClient* client_; |
57 MotionEventAura pointer_state_; | 55 MotionEventAura pointer_state_; |
58 FilteredGestureProvider filtered_gesture_provider_; | 56 FilteredGestureProvider filtered_gesture_provider_; |
59 | 57 |
60 bool handling_event_; | 58 bool handling_event_; |
61 std::vector<std::unique_ptr<GestureEvent>> pending_gestures_; | 59 std::vector<std::unique_ptr<GestureEvent>> pending_gestures_; |
62 | 60 |
63 // |gesture_consumer_| must outlive this object. | 61 // |gesture_consumer_| must outlive this object. |
64 GestureConsumer* gesture_consumer_; | 62 GestureConsumer* gesture_consumer_; |
65 | 63 |
66 DISALLOW_COPY_AND_ASSIGN(GestureProviderAura); | 64 DISALLOW_COPY_AND_ASSIGN(GestureProviderAura); |
67 }; | 65 }; |
68 | 66 |
69 } // namespace ui | 67 } // namespace ui |
70 | 68 |
71 #endif // UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ | 69 #endif // UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_ |
OLD | NEW |