| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 SetupTargets(*event, consumer); | 244 SetupTargets(*event, consumer); |
| 245 | 245 |
| 246 if (event->result() & ER_CONSUMED) | 246 if (event->result() & ER_CONSUMED) |
| 247 return false; | 247 return false; |
| 248 | 248 |
| 249 GestureProviderAura* gesture_provider = | 249 GestureProviderAura* gesture_provider = |
| 250 GetGestureProviderForConsumer(consumer); | 250 GetGestureProviderForConsumer(consumer); |
| 251 return gesture_provider->OnTouchEvent(event); | 251 return gesture_provider->OnTouchEvent(event); |
| 252 } | 252 } |
| 253 | 253 |
| 254 // TODO(tdresser): we should take a unique_event_id here, and validate |
| 255 // that the correct event is being acked. See crbug.com/457669 for |
| 256 // details. |
| 254 GestureRecognizer::Gestures* | 257 GestureRecognizer::Gestures* |
| 255 GestureRecognizerImpl::AckAsyncTouchEvent( | 258 GestureRecognizerImpl::AckAsyncTouchEvent( |
| 256 const TouchEvent& event, | |
| 257 ui::EventResult result, | 259 ui::EventResult result, |
| 258 GestureConsumer* consumer) { | 260 GestureConsumer* consumer) { |
| 259 GestureProviderAura* gesture_provider = | 261 GestureProviderAura* gesture_provider = |
| 260 GetGestureProviderForConsumer(consumer); | 262 GetGestureProviderForConsumer(consumer); |
| 261 gesture_provider->OnAsyncTouchEventAck(result != ER_UNHANDLED); | 263 gesture_provider->OnAsyncTouchEventAck(result != ER_UNHANDLED); |
| 262 return gesture_provider->GetAndResetPendingGestures(); | 264 return gesture_provider->GetAndResetPendingGestures(); |
| 263 } | 265 } |
| 264 | 266 |
| 265 GestureRecognizer::Gestures* GestureRecognizerImpl::AckSyncTouchEvent( | 267 GestureRecognizer::Gestures* GestureRecognizerImpl::AckSyncTouchEvent( |
| 266 const uint64 unique_event_id, | 268 const uint64 unique_event_id, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 std::vector<GestureEventHelper*>::iterator it; | 344 std::vector<GestureEventHelper*>::iterator it; |
| 343 for (it = helpers.begin(); it != helpers.end(); ++it) | 345 for (it = helpers.begin(); it != helpers.end(); ++it) |
| 344 gesture_recognizer->AddGestureEventHelper(*it); | 346 gesture_recognizer->AddGestureEventHelper(*it); |
| 345 | 347 |
| 346 helpers.clear(); | 348 helpers.clear(); |
| 347 g_gesture_recognizer_instance = | 349 g_gesture_recognizer_instance = |
| 348 static_cast<GestureRecognizerImpl*>(gesture_recognizer); | 350 static_cast<GestureRecognizerImpl*>(gesture_recognizer); |
| 349 } | 351 } |
| 350 | 352 |
| 351 } // namespace ui | 353 } // namespace ui |
| OLD | NEW |