| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // Check if we have already processed this event before dispatch and have a | 288 // Check if we have already processed this event before dispatch and have a |
| 289 // consumer associated with it. | 289 // consumer associated with it. |
| 290 auto event_to_gesture_provider_iterator = | 290 auto event_to_gesture_provider_iterator = |
| 291 event_to_gesture_provider_.find(unique_event_id); | 291 event_to_gesture_provider_.find(unique_event_id); |
| 292 if (event_to_gesture_provider_iterator != event_to_gesture_provider_.end()) { | 292 if (event_to_gesture_provider_iterator != event_to_gesture_provider_.end()) { |
| 293 gesture_provider = event_to_gesture_provider_iterator->second; | 293 gesture_provider = event_to_gesture_provider_iterator->second; |
| 294 event_to_gesture_provider_.erase(event_to_gesture_provider_iterator); | 294 event_to_gesture_provider_.erase(event_to_gesture_provider_iterator); |
| 295 } else { | 295 } else { |
| 296 gesture_provider = GetGestureProviderForConsumer(consumer); | 296 gesture_provider = GetGestureProviderForConsumer(consumer); |
| 297 } | 297 } |
| 298 gesture_provider->OnTouchEventAck(unique_event_id, result != ER_UNHANDLED); | 298 gesture_provider->OnTouchEventAck(unique_event_id, result); |
| 299 return gesture_provider->GetAndResetPendingGestures(); | 299 return gesture_provider->GetAndResetPendingGestures(); |
| 300 } | 300 } |
| 301 | 301 |
| 302 bool GestureRecognizerImpl::CleanupStateForConsumer( | 302 bool GestureRecognizerImpl::CleanupStateForConsumer( |
| 303 GestureConsumer* consumer) { | 303 GestureConsumer* consumer) { |
| 304 bool state_cleaned_up = false; | 304 bool state_cleaned_up = false; |
| 305 | 305 |
| 306 auto consumer_gesture_provider_it = consumer_gesture_provider_.find(consumer); | 306 auto consumer_gesture_provider_it = consumer_gesture_provider_.find(consumer); |
| 307 if (consumer_gesture_provider_it != consumer_gesture_provider_.end()) { | 307 if (consumer_gesture_provider_it != consumer_gesture_provider_.end()) { |
| 308 // Remove gesture provider associated with the consumer from | 308 // Remove gesture provider associated with the consumer from |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 std::vector<GestureEventHelper*>::iterator it; | 371 std::vector<GestureEventHelper*>::iterator it; |
| 372 for (it = helpers.begin(); it != helpers.end(); ++it) | 372 for (it = helpers.begin(); it != helpers.end(); ++it) |
| 373 gesture_recognizer->AddGestureEventHelper(*it); | 373 gesture_recognizer->AddGestureEventHelper(*it); |
| 374 | 374 |
| 375 helpers.clear(); | 375 helpers.clear(); |
| 376 g_gesture_recognizer_instance = | 376 g_gesture_recognizer_instance = |
| 377 static_cast<GestureRecognizerImpl*>(gesture_recognizer); | 377 static_cast<GestureRecognizerImpl*>(gesture_recognizer); |
| 378 } | 378 } |
| 379 | 379 |
| 380 } // namespace ui | 380 } // namespace ui |
| OLD | NEW |