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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 void GestureRecognizerImpl::DispatchGestureEvent(GestureEvent* event) { | 229 void GestureRecognizerImpl::DispatchGestureEvent(GestureEvent* event) { |
230 GestureConsumer* consumer = GetTargetForGestureEvent(*event); | 230 GestureConsumer* consumer = GetTargetForGestureEvent(*event); |
231 if (consumer) { | 231 if (consumer) { |
232 GestureEventHelper* helper = FindDispatchHelperForConsumer(consumer); | 232 GestureEventHelper* helper = FindDispatchHelperForConsumer(consumer); |
233 if (helper) | 233 if (helper) |
234 helper->DispatchGestureEvent(event); | 234 helper->DispatchGestureEvent(event); |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 bool GestureRecognizerImpl::ProcessTouchEventPreDispatch( | 238 bool GestureRecognizerImpl::ProcessTouchEventPreDispatch( |
239 const TouchEvent& event, | 239 TouchEvent* event, |
240 GestureConsumer* consumer) { | 240 GestureConsumer* consumer) { |
241 SetupTargets(event, consumer); | 241 SetupTargets(*event, consumer); |
242 | 242 |
243 if (event.result() & ER_CONSUMED) | 243 if (event->result() & ER_CONSUMED) |
244 return false; | 244 return false; |
245 | 245 |
246 GestureProviderAura* gesture_provider = | 246 GestureProviderAura* gesture_provider = |
247 GetGestureProviderForConsumer(consumer); | 247 GetGestureProviderForConsumer(consumer); |
248 return gesture_provider->OnTouchEvent(event); | 248 return gesture_provider->OnTouchEvent(event); |
249 } | 249 } |
250 | 250 |
251 GestureRecognizer::Gestures* | 251 GestureRecognizer::Gestures* |
252 GestureRecognizerImpl::ProcessTouchEventPostDispatch( | 252 GestureRecognizerImpl::ProcessTouchEventPostDispatch( |
253 const TouchEvent& event, | 253 const TouchEvent& event, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 std::vector<GestureEventHelper*>::iterator it; | 340 std::vector<GestureEventHelper*>::iterator it; |
341 for (it = helpers.begin(); it != helpers.end(); ++it) | 341 for (it = helpers.begin(); it != helpers.end(); ++it) |
342 gesture_recognizer->AddGestureEventHelper(*it); | 342 gesture_recognizer->AddGestureEventHelper(*it); |
343 | 343 |
344 helpers.clear(); | 344 helpers.clear(); |
345 g_gesture_recognizer_instance = | 345 g_gesture_recognizer_instance = |
346 static_cast<GestureRecognizerImpl*>(gesture_recognizer); | 346 static_cast<GestureRecognizerImpl*>(gesture_recognizer); |
347 } | 347 } |
348 | 348 |
349 } // namespace ui | 349 } // namespace ui |
OLD | NEW |