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

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

Issue 2869823003: [VSync Queue] Plug touch ack to gesture events and flush vsync queue if necessary (Closed)
Patch Set: Fix MSAN Use-of-uninitialized-value: Initialize GestureEventDetails Created 3 years, 6 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint( 175 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint(
176 Window* window, 176 Window* window,
177 const gfx::Point& point) { 177 const gfx::Point& point) {
178 ui::MouseEvent event(ui::ET_MOUSE_EXITED, point, point, ui::EventTimeForNow(), 178 ui::MouseEvent event(ui::ET_MOUSE_EXITED, point, point, ui::EventTimeForNow(),
179 ui::EF_NONE, ui::EF_NONE); 179 ui::EF_NONE, ui::EF_NONE);
180 return DispatchMouseEnterOrExit(window, event, ui::ET_MOUSE_EXITED); 180 return DispatchMouseEnterOrExit(window, event, ui::ET_MOUSE_EXITED);
181 } 181 }
182 182
183 void WindowEventDispatcher::ProcessedTouchEvent(uint32_t unique_event_id, 183 void WindowEventDispatcher::ProcessedTouchEvent(
184 Window* window, 184 uint32_t unique_event_id,
185 ui::EventResult result) { 185 Window* window,
186 ui::EventResult result,
187 bool is_source_touch_event_set_non_blocking) {
186 ui::GestureRecognizer::Gestures gestures = 188 ui::GestureRecognizer::Gestures gestures =
187 ui::GestureRecognizer::Get()->AckTouchEvent(unique_event_id, result, 189 ui::GestureRecognizer::Get()->AckTouchEvent(
188 window); 190 unique_event_id, result, is_source_touch_event_set_non_blocking,
191 window);
189 DispatchDetails details = ProcessGestures(window, std::move(gestures)); 192 DispatchDetails details = ProcessGestures(window, std::move(gestures));
190 if (details.dispatcher_destroyed) 193 if (details.dispatcher_destroyed)
191 return; 194 return;
192 } 195 }
193 196
194 void WindowEventDispatcher::HoldPointerMoves() { 197 void WindowEventDispatcher::HoldPointerMoves() {
195 if (!move_hold_count_) 198 if (!move_hold_count_)
196 held_event_factory_.InvalidateWeakPtrs(); 199 held_event_factory_.InvalidateWeakPtrs();
197 ++move_hold_count_; 200 ++move_hold_count_;
198 TRACE_EVENT_ASYNC_BEGIN0("ui", "WindowEventDispatcher::HoldPointerMoves", 201 TRACE_EVENT_ASYNC_BEGIN0("ui", "WindowEventDispatcher::HoldPointerMoves",
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 // Do not let 'held' touch events contribute to any gestures unless it is 551 // Do not let 'held' touch events contribute to any gestures unless it is
549 // being dispatched. 552 // being dispatched.
550 if (is_dispatched_held_event(event) || !held_move_event_ || 553 if (is_dispatched_held_event(event) || !held_move_event_ ||
551 !held_move_event_->IsTouchEvent()) { 554 !held_move_event_->IsTouchEvent()) {
552 const ui::TouchEvent& touchevent = *event.AsTouchEvent(); 555 const ui::TouchEvent& touchevent = *event.AsTouchEvent();
553 556
554 if (!touchevent.synchronous_handling_disabled()) { 557 if (!touchevent.synchronous_handling_disabled()) {
555 Window* window = static_cast<Window*>(target); 558 Window* window = static_cast<Window*>(target);
556 ui::GestureRecognizer::Gestures gestures = 559 ui::GestureRecognizer::Gestures gestures =
557 ui::GestureRecognizer::Get()->AckTouchEvent( 560 ui::GestureRecognizer::Get()->AckTouchEvent(
558 touchevent.unique_event_id(), event.result(), window); 561 touchevent.unique_event_id(), event.result(),
562 false /* is_source_touch_event_set_non_blocking */, window);
559 563
560 return ProcessGestures(window, std::move(gestures)); 564 return ProcessGestures(window, std::move(gestures));
561 } 565 }
562 } 566 }
563 } 567 }
564 568
565 return details; 569 return details;
566 } 570 }
567 571
568 //////////////////////////////////////////////////////////////////////////////// 572 ////////////////////////////////////////////////////////////////////////////////
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 ui::KeyEvent* event) { 941 ui::KeyEvent* event) {
938 if (skip_ime_ || !host_->has_input_method() || 942 if (skip_ime_ || !host_->has_input_method() ||
939 (event->flags() & ui::EF_IS_SYNTHESIZED)) 943 (event->flags() & ui::EF_IS_SYNTHESIZED))
940 return ui::EventDispatchDetails(); 944 return ui::EventDispatchDetails();
941 host_->GetInputMethod()->DispatchKeyEvent(event); 945 host_->GetInputMethod()->DispatchKeyEvent(event);
942 event->StopPropagation(); 946 event->StopPropagation();
943 return ui::EventDispatchDetails(); 947 return ui::EventDispatchDetails();
944 } 948 }
945 949
946 } // namespace aura 950 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698