Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: ui/aura/window_event_dispatcher.cc

Issue 536843003: Disable eager gesture detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable test depending on eager behavior. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_event_dispatcher.cc
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
index 3619dcc8c92c490b9c59555ae149741aea103794..d990082f6f808260703ef7e54c31a6fbec5d96e5 100644
--- a/ui/aura/window_event_dispatcher.cc
+++ b/ui/aura/window_event_dispatcher.cc
@@ -160,6 +160,14 @@ void WindowEventDispatcher::ProcessedTouchEvent(ui::TouchEvent* event,
Window* window,
ui::EventResult result) {
ui::TouchEvent orig_event(*event, window, this->window());
+
+ // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager
+ // gesture detection. See crbug.com/410280.
+ if (!ui::GestureRecognizer::Get()
+ ->ProcessTouchEventPreDispatch(orig_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(
@@ -495,16 +503,26 @@ ui::EventDispatchDetails WindowEventDispatcher::PostDispatchEvent(
// being dispatched.
if (dispatching_held_event_ || !held_move_event_ ||
!held_move_event_->IsTouchEvent()) {
- // If the event is being handled asynchronously, ignore it.
- if(event.result() & ui::ER_CONSUMED)
- return details;
- scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
// 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.result() & ui::ER_CONSUMED)
+ orig_event.StopPropagation();
+
+ // 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;
+ }
+
+ scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
+
gestures.reset(
ui::GestureRecognizer::Get()->ProcessTouchEventPostDispatch(
orig_event, event.result(), static_cast<Window*>(target)));
@@ -888,19 +906,6 @@ void WindowEventDispatcher::PreDispatchTouchEvent(Window* target,
break;
}
- if (dispatching_held_event_ || !held_move_event_ ||
- !held_move_event_->IsTouchEvent()) {
- ui::TouchEvent orig_event(*event, target, window());
-
- // If the touch event is invalid in some way, the gesture recognizer will
- // reject it. This must call |StopPropagation()|, in order to prevent the
- // touch from being acked in |PostDispatchEvent|.
- if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event,
- target)) {
- event->StopPropagation();
- }
- }
-
PreDispatchLocatedEvent(target, event);
}
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698