| Index: ui/aura/window_event_dispatcher.cc
|
| diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
|
| index eadda03f6794645960382900eb4dcc4970ebb0a6..0d720a0d5e7721d722243bd50ffa1e7b536a272f 100644
|
| --- a/ui/aura/window_event_dispatcher.cc
|
| +++ b/ui/aura/window_event_dispatcher.cc
|
| @@ -159,17 +159,10 @@ DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint(
|
| void WindowEventDispatcher::ProcessedTouchEvent(ui::TouchEvent* event,
|
| Window* window,
|
| ui::EventResult result) {
|
| - // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager
|
| - // gesture detection. See crbug.com/410280.
|
| - if (!ui::GestureRecognizer::Get()
|
| - ->ProcessTouchEventPreDispatch(*event, window)) {
|
| - return;
|
| - }
|
| -
|
| // Once we've fully migrated to the eager gesture detector, we won't need to
|
| // pass an event here.
|
| scoped_ptr<ui::GestureRecognizer::Gestures> gestures(
|
| - ui::GestureRecognizer::Get()->ProcessTouchEventOnAsyncAck(
|
| + ui::GestureRecognizer::Get()->ProcessTouchEventPostDispatch(
|
| *event, result, window));
|
| DispatchDetails details = ProcessGestures(gestures.get());
|
| if (details.dispatcher_destroyed)
|
| @@ -499,30 +492,18 @@ ui::EventDispatchDetails WindowEventDispatcher::PostDispatchEvent(
|
| if (dispatching_held_event_ || !held_move_event_ ||
|
| !held_move_event_->IsTouchEvent()) {
|
|
|
| - // Once we've fully migrated to the eager gesture detector, we won't
|
| - // need to pass an event here.
|
| - ui::TouchEvent orig_event(static_cast<const ui::TouchEvent&>(event),
|
| - static_cast<Window*>(event.target()),
|
| - window());
|
| + if (!event.synchronous_handling_disabled()) {
|
| + scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
|
|
|
| - if (event.result() & ui::ER_CONSUMED)
|
| - orig_event.StopPropagation();
|
| + // Once we've fully migrated to the eager gesture detector, we won't
|
| + // need to pass an event here.
|
| + gestures.reset(
|
| + ui::GestureRecognizer::Get()->ProcessTouchEventPostDispatch(
|
| + static_cast<const ui::TouchEvent&>(event), event.result(),
|
| + static_cast<Window*>(target)));
|
|
|
| - // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager
|
| - // gesture detection. See crbug.com/410280.
|
| - if (!ui::GestureRecognizer::Get()
|
| - ->ProcessTouchEventPreDispatch(orig_event,
|
| - static_cast<Window*>(target))) {
|
| - return details;
|
| + return ProcessGestures(gestures.get());
|
| }
|
| -
|
| - scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
|
| -
|
| - gestures.reset(
|
| - ui::GestureRecognizer::Get()->ProcessTouchEventPostDispatch(
|
| - orig_event, event.result(), static_cast<Window*>(target)));
|
| -
|
| - return ProcessGestures(gestures.get());
|
| }
|
| }
|
|
|
| @@ -901,6 +882,14 @@ void WindowEventDispatcher::PreDispatchTouchEvent(Window* target,
|
| break;
|
| }
|
|
|
| + ui::TouchEvent orig_event(*event, target, window());
|
| + if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event,
|
| + target)) {
|
| + event->StopPropagation();
|
| + event->DisableSynchronousHandling();
|
| + return;
|
| + }
|
| +
|
| PreDispatchLocatedEvent(target, event);
|
| }
|
|
|
|
|