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

Side by Side Diff: ui/aura/window_event_dispatcher.cc

Issue 503883004: Don't pass touches to gesture recognizer for async acks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address (most of) sadrul's comments. Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/aura/window_event_dispatcher.h" 5 #include "ui/aura/window_event_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint( 152 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint(
153 Window* window, 153 Window* window,
154 const gfx::Point& point) { 154 const gfx::Point& point) {
155 ui::MouseEvent event(ui::ET_MOUSE_EXITED, point, point, ui::EF_NONE, 155 ui::MouseEvent event(ui::ET_MOUSE_EXITED, point, point, ui::EF_NONE,
156 ui::EF_NONE); 156 ui::EF_NONE);
157 return DispatchMouseEnterOrExit(window, event, ui::ET_MOUSE_EXITED); 157 return DispatchMouseEnterOrExit(window, event, ui::ET_MOUSE_EXITED);
158 } 158 }
159 159
160 void WindowEventDispatcher::ProcessedTouchEvent(ui::TouchEvent* event, 160 void WindowEventDispatcher::ProcessedTouchEvent(Window* window,
161 Window* window,
162 ui::EventResult result) { 161 ui::EventResult result) {
163 // Once we've fully migrated to the eager gesture detector, we won't need to
164 // pass an event here.
165 scoped_ptr<ui::GestureRecognizer::Gestures> gestures( 162 scoped_ptr<ui::GestureRecognizer::Gestures> gestures(
166 ui::GestureRecognizer::Get()->AckAsyncTouchEvent( 163 ui::GestureRecognizer::Get()->AckAsyncTouchEvent(result, window));
167 *event, result, window));
168 DispatchDetails details = ProcessGestures(gestures.get()); 164 DispatchDetails details = ProcessGestures(gestures.get());
169 if (details.dispatcher_destroyed) 165 if (details.dispatcher_destroyed)
170 return; 166 return;
171 } 167 }
172 168
173 void WindowEventDispatcher::HoldPointerMoves() { 169 void WindowEventDispatcher::HoldPointerMoves() {
174 if (!move_hold_count_) 170 if (!move_hold_count_)
175 held_event_factory_.InvalidateWeakPtrs(); 171 held_event_factory_.InvalidateWeakPtrs();
176 ++move_hold_count_; 172 ++move_hold_count_;
177 TRACE_EVENT_ASYNC_BEGIN0("ui", "WindowEventDispatcher::HoldPointerMoves", 173 TRACE_EVENT_ASYNC_BEGIN0("ui", "WindowEventDispatcher::HoldPointerMoves",
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 } 892 }
897 893
898 // This flag is set depending on the gestures recognized in the call above, 894 // This flag is set depending on the gestures recognized in the call above,
899 // and needs to propagate with the forwarded event. 895 // and needs to propagate with the forwarded event.
900 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); 896 event->set_may_cause_scrolling(orig_event.may_cause_scrolling());
901 897
902 PreDispatchLocatedEvent(target, event); 898 PreDispatchLocatedEvent(target, event);
903 } 899 }
904 900
905 } // namespace aura 901 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698