| 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_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 5 #ifndef UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
| 6 #define UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 6 #define UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 virtual void TransferEventsTo(GestureConsumer* current_consumer, | 39 virtual void TransferEventsTo(GestureConsumer* current_consumer, |
| 40 GestureConsumer* new_consumer) OVERRIDE; | 40 GestureConsumer* new_consumer) OVERRIDE; |
| 41 virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer, | 41 virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer, |
| 42 gfx::Point* point) OVERRIDE; | 42 gfx::Point* point) OVERRIDE; |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 virtual GestureSequence* CreateSequence(GestureEventHelper* helper); | 45 virtual GestureSequence* CreateSequence(GestureEventHelper* helper); |
| 46 virtual GestureSequence* GetGestureSequenceForConsumer(GestureConsumer* c); | 46 virtual GestureSequence* GetGestureSequenceForConsumer(GestureConsumer* c); |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 // Sets up the target consumer for gestures based on the touch-event. |
| 50 void SetupTargets(const TouchEvent& event, GestureConsumer* consumer); |
| 51 |
| 52 // Processes the next queued touch-event (and discards the touch-event). The |
| 53 // called must take ownership of the returned gestures and free them when they |
| 54 // are not needed anymore. |
| 55 Gestures* AdvanceTouchQueueByOne(GestureConsumer* consumer, |
| 56 ui::TouchStatus status); |
| 57 |
| 49 // Overridden from GestureRecognizer | 58 // Overridden from GestureRecognizer |
| 50 virtual Gestures* ProcessTouchEventForGesture( | 59 virtual Gestures* ProcessTouchEventForGesture( |
| 51 const TouchEvent& event, | 60 const TouchEvent& event, |
| 52 ui::TouchStatus status, | 61 ui::TouchStatus status, |
| 53 GestureConsumer* target) OVERRIDE; | 62 GestureConsumer* target) OVERRIDE; |
| 54 virtual void QueueTouchEventForGesture(GestureConsumer* consumer, | 63 virtual void QueueTouchEventForGesture(GestureConsumer* consumer, |
| 55 const TouchEvent& event) OVERRIDE; | 64 const TouchEvent& event) OVERRIDE; |
| 56 virtual Gestures* AdvanceTouchQueue(GestureConsumer* consumer, | 65 virtual Gestures* AdvanceTouchQueue(GestureConsumer* consumer, |
| 57 bool processed) OVERRIDE; | 66 bool processed) OVERRIDE; |
| 58 virtual void FlushTouchQueue(GestureConsumer* consumer) OVERRIDE; | 67 virtual void FlushTouchQueue(GestureConsumer* consumer) OVERRIDE; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 72 // gesture_consumer_ignorer_. | 81 // gesture_consumer_ignorer_. |
| 73 scoped_ptr<GestureConsumer> gesture_consumer_ignorer_; | 82 scoped_ptr<GestureConsumer> gesture_consumer_ignorer_; |
| 74 GestureEventHelper* helper_; | 83 GestureEventHelper* helper_; |
| 75 | 84 |
| 76 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImpl); | 85 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImpl); |
| 77 }; | 86 }; |
| 78 | 87 |
| 79 } // namespace ui | 88 } // namespace ui |
| 80 | 89 |
| 81 #endif // UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 90 #endif // UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
| OLD | NEW |