| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 5 #ifndef UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
| 6 #define UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 6 #define UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 const TouchEvent& event) override; | 40 const TouchEvent& event) override; |
| 41 GestureConsumer* GetTargetForGestureEvent( | 41 GestureConsumer* GetTargetForGestureEvent( |
| 42 const GestureEvent& event) override; | 42 const GestureEvent& event) override; |
| 43 GestureConsumer* GetTargetForLocation( | 43 GestureConsumer* GetTargetForLocation( |
| 44 const gfx::PointF& location, int source_device_id) override; | 44 const gfx::PointF& location, int source_device_id) override; |
| 45 void TransferEventsTo(GestureConsumer* current_consumer, | 45 void TransferEventsTo(GestureConsumer* current_consumer, |
| 46 GestureConsumer* new_consumer) override; | 46 GestureConsumer* new_consumer) override; |
| 47 bool GetLastTouchPointForTarget(GestureConsumer* consumer, | 47 bool GetLastTouchPointForTarget(GestureConsumer* consumer, |
| 48 gfx::PointF* point) override; | 48 gfx::PointF* point) override; |
| 49 bool CancelActiveTouches(GestureConsumer* consumer) override; | 49 bool CancelActiveTouches(GestureConsumer* consumer) override; |
| 50 void CancelActiveTouchesExcept(GestureConsumer* not_cancelled) override; |
| 50 | 51 |
| 51 protected: | 52 protected: |
| 52 virtual GestureProviderImpl* GetGestureProviderForConsumer( | 53 virtual GestureProviderImpl* GetGestureProviderForConsumer( |
| 53 GestureConsumer* c); | 54 GestureConsumer* c); |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 // Sets up the target consumer for gestures based on the touch-event. | 57 // Sets up the target consumer for gestures based on the touch-event. |
| 57 void SetupTargets(const TouchEvent& event, GestureConsumer* consumer); | 58 void SetupTargets(const TouchEvent& event, GestureConsumer* consumer); |
| 58 | 59 |
| 59 void DispatchGestureEvent(GestureEvent* event); | 60 void DispatchGestureEvent(GestureEvent* event); |
| 60 | 61 |
| 61 // Overridden from GestureRecognizer | 62 // Overridden from GestureRecognizer |
| 62 bool ProcessTouchEventPreDispatch(const TouchEvent& event, | 63 bool ProcessTouchEventPreDispatch(TouchEvent* event, |
| 63 GestureConsumer* consumer) override; | 64 GestureConsumer* consumer) override; |
| 64 | 65 |
| 65 Gestures* ProcessTouchEventPostDispatch( | 66 Gestures* AckTouchEvent(uint32 unique_event_id, |
| 66 const TouchEvent& event, | 67 ui::EventResult result, |
| 67 ui::EventResult result, | 68 GestureConsumer* consumer) override; |
| 68 GestureConsumer* consumer) override; | |
| 69 | |
| 70 Gestures* ProcessTouchEventOnAsyncAck( | |
| 71 const TouchEvent& event, | |
| 72 ui::EventResult result, | |
| 73 GestureConsumer* consumer) override; | |
| 74 | 69 |
| 75 bool CleanupStateForConsumer(GestureConsumer* consumer) override; | 70 bool CleanupStateForConsumer(GestureConsumer* consumer) override; |
| 76 void AddGestureEventHelper(GestureEventHelper* helper) override; | 71 void AddGestureEventHelper(GestureEventHelper* helper) override; |
| 77 void RemoveGestureEventHelper(GestureEventHelper* helper) override; | 72 void RemoveGestureEventHelper(GestureEventHelper* helper) override; |
| 78 | 73 |
| 79 // Overridden from GestureProviderImplClient | 74 // Overridden from GestureProviderImplClient |
| 80 void OnGestureEvent(GestureEvent* event) override; | 75 void OnGestureEvent(GestureEvent* event) override; |
| 81 | 76 |
| 82 // Convenience method to find the GestureEventHelper that can dispatch events | 77 // Convenience method to find the GestureEventHelper that can dispatch events |
| 83 // to a specific |consumer|. | 78 // to a specific |consumer|. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 96 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImpl); | 91 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImpl); |
| 97 }; | 92 }; |
| 98 | 93 |
| 99 // Provided only for testing: | 94 // Provided only for testing: |
| 100 EVENTS_EXPORT void SetGestureRecognizerForTesting( | 95 EVENTS_EXPORT void SetGestureRecognizerForTesting( |
| 101 GestureRecognizer* gesture_recognizer); | 96 GestureRecognizer* gesture_recognizer); |
| 102 | 97 |
| 103 } // namespace ui | 98 } // namespace ui |
| 104 | 99 |
| 105 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 100 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
| OLD | NEW |