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

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

Issue 469523003: Add the actual location coordinates to the touch cancel event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change after removing the old gesture 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 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/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 DispatchDetails details = 133 DispatchDetails details =
134 DispatchEvent(focused_window ? focused_window : window(), &event); 134 DispatchEvent(focused_window ? focused_window : window(), &event);
135 if (details.dispatcher_destroyed) 135 if (details.dispatcher_destroyed)
136 return; 136 return;
137 } 137 }
138 138
139 void WindowEventDispatcher::DispatchGestureEvent(ui::GestureEvent* event) { 139 void WindowEventDispatcher::DispatchGestureEvent(ui::GestureEvent* event) {
140 DispatchDetails details = DispatchHeldEvents(); 140 DispatchDetails details = DispatchHeldEvents();
141 if (details.dispatcher_destroyed) 141 if (details.dispatcher_destroyed)
142 return; 142 return;
143
144 Window* target = GetGestureTarget(event); 143 Window* target = GetGestureTarget(event);
145 if (target) { 144 if (target) {
146 event->ConvertLocationToTarget(window(), target); 145 event->ConvertLocationToTarget(window(), target);
147 DispatchDetails details = DispatchEvent(target, event); 146 DispatchDetails details = DispatchEvent(target, event);
148 if (details.dispatcher_destroyed) 147 if (details.dispatcher_destroyed)
149 return; 148 return;
150 } 149 }
151 } 150 }
152 151
153 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint( 152 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint(
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 return window(); 429 return window();
431 } 430 }
432 431
433 void WindowEventDispatcher::PrepareEventForDispatch(ui::Event* event) { 432 void WindowEventDispatcher::PrepareEventForDispatch(ui::Event* event) {
434 if (dispatching_held_event_) { 433 if (dispatching_held_event_) {
435 // The held events are already in |window()|'s coordinate system. So it is 434 // The held events are already in |window()|'s coordinate system. So it is
436 // not necessary to apply the transform to convert from the host's 435 // not necessary to apply the transform to convert from the host's
437 // coordinate system to |window()|'s coordinate system. 436 // coordinate system to |window()|'s coordinate system.
438 return; 437 return;
439 } 438 }
440 if (event->IsMouseEvent() || 439 if (event->IsLocatedEvent() && event->HasNativeEvent()) {
441 event->IsScrollEvent() ||
442 event->IsTouchEvent() ||
443 event->IsGestureEvent()) {
444 TransformEventForDeviceScaleFactor(static_cast<ui::LocatedEvent*>(event)); 440 TransformEventForDeviceScaleFactor(static_cast<ui::LocatedEvent*>(event));
445 } 441 }
446 } 442 }
447 443
448 //////////////////////////////////////////////////////////////////////////////// 444 ////////////////////////////////////////////////////////////////////////////////
449 // WindowEventDispatcher, ui::EventDispatcherDelegate implementation: 445 // WindowEventDispatcher, ui::EventDispatcherDelegate implementation:
450 446
451 bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) { 447 bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) {
452 return event_dispatch_target_ == target; 448 return event_dispatch_target_ == target;
453 } 449 }
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event, 894 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event,
899 target)) { 895 target)) {
900 event->StopPropagation(); 896 event->StopPropagation();
901 } 897 }
902 } 898 }
903 899
904 PreDispatchLocatedEvent(target, event); 900 PreDispatchLocatedEvent(target, event);
905 } 901 }
906 902
907 } // namespace aura 903 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698