| 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 #include "ui/events/gestures/gesture_recognizer_impl.h" | 5 #include "ui/events/gestures/gesture_recognizer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // active touches may cause the consumer to be removed from | 107 // active touches may cause the consumer to be removed from |
| 108 // |consumer_gesture_provider_|. See crbug.com/651258 for more info. | 108 // |consumer_gesture_provider_|. See crbug.com/651258 for more info. |
| 109 std::vector<GestureConsumer*> consumers(consumer_gesture_provider_.size()); | 109 std::vector<GestureConsumer*> consumers(consumer_gesture_provider_.size()); |
| 110 for (const auto& entry : consumer_gesture_provider_) { | 110 for (const auto& entry : consumer_gesture_provider_) { |
| 111 if (entry.first == not_cancelled) | 111 if (entry.first == not_cancelled) |
| 112 continue; | 112 continue; |
| 113 | 113 |
| 114 consumers.push_back(entry.first); | 114 consumers.push_back(entry.first); |
| 115 } | 115 } |
| 116 | 116 |
| 117 for (auto consumer : consumers) | 117 for (auto* consumer : consumers) |
| 118 CancelActiveTouches(consumer); | 118 CancelActiveTouches(consumer); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void GestureRecognizerImpl::TransferEventsTo( | 121 void GestureRecognizerImpl::TransferEventsTo( |
| 122 GestureConsumer* current_consumer, | 122 GestureConsumer* current_consumer, |
| 123 GestureConsumer* new_consumer, | 123 GestureConsumer* new_consumer, |
| 124 ShouldCancelTouches should_cancel_touches) { | 124 ShouldCancelTouches should_cancel_touches) { |
| 125 // This method transfers the gesture stream from |current_consumer| to | 125 // This method transfers the gesture stream from |current_consumer| to |
| 126 // |new_consumer|. If |should_cancel_touches| is Cancel, it ensures that both | 126 // |new_consumer|. If |should_cancel_touches| is Cancel, it ensures that both |
| 127 // consumers retain a touch event stream which is reasonably valid. In order | 127 // consumers retain a touch event stream which is reasonably valid. In order |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 std::vector<GestureEventHelper*>::iterator it; | 351 std::vector<GestureEventHelper*>::iterator it; |
| 352 for (it = helpers.begin(); it != helpers.end(); ++it) | 352 for (it = helpers.begin(); it != helpers.end(); ++it) |
| 353 gesture_recognizer->AddGestureEventHelper(*it); | 353 gesture_recognizer->AddGestureEventHelper(*it); |
| 354 | 354 |
| 355 helpers.clear(); | 355 helpers.clear(); |
| 356 g_gesture_recognizer_instance = | 356 g_gesture_recognizer_instance = |
| 357 static_cast<GestureRecognizerImpl*>(gesture_recognizer); | 357 static_cast<GestureRecognizerImpl*>(gesture_recognizer); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace ui | 360 } // namespace ui |
| OLD | NEW |