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

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

Issue 1907323003: Drag and drop cleans up touch sequences from the source window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update GR state without actually dispatching press events. Created 4 years, 7 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
« no previous file with comments | « ui/aura/window_event_dispatcher.h ('k') | ui/events/gesture_detection/gesture_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 521
522 //////////////////////////////////////////////////////////////////////////////// 522 ////////////////////////////////////////////////////////////////////////////////
523 // WindowEventDispatcher, ui::GestureEventHelper implementation: 523 // WindowEventDispatcher, ui::GestureEventHelper implementation:
524 524
525 bool WindowEventDispatcher::CanDispatchToConsumer( 525 bool WindowEventDispatcher::CanDispatchToConsumer(
526 ui::GestureConsumer* consumer) { 526 ui::GestureConsumer* consumer) {
527 Window* consumer_window = ConsumerToWindow(consumer); 527 Window* consumer_window = ConsumerToWindow(consumer);
528 return (consumer_window && consumer_window->GetRootWindow() == window()); 528 return (consumer_window && consumer_window->GetRootWindow() == window());
529 } 529 }
530 530
531 void WindowEventDispatcher::DispatchCancelTouchEvent( 531 void WindowEventDispatcher::DispatchSyntheticTouchEvent(ui::TouchEvent* event) {
532 ui::GestureConsumer* raw_input_consumer, 532 // The synthetic event's location is based on the last known location of
533 ui::TouchEvent* event) {
534 // The touchcancel event's location is based on the last known location of
535 // the pointer, in dips. OnEventFromSource expects events with co-ordinates 533 // the pointer, in dips. OnEventFromSource expects events with co-ordinates
536 // in raw pixels, so we convert back to raw pixels here. 534 // in raw pixels, so we convert back to raw pixels here.
sadrul 2016/05/11 16:12:17 Can you add a DCHECK() here that |event->type()| i
tdresser 2016/05/11 16:32:31 Done.
537 event->UpdateForRootTransform(host_->GetRootTransform()); 535 event->UpdateForRootTransform(host_->GetRootTransform());
538 DispatchDetails details = OnEventFromSource(event); 536 DispatchDetails details = OnEventFromSource(event);
539 if (details.dispatcher_destroyed) 537 if (details.dispatcher_destroyed)
540 return; 538 return;
541 } 539 }
542 540
543 //////////////////////////////////////////////////////////////////////////////// 541 ////////////////////////////////////////////////////////////////////////////////
544 // WindowEventDispatcher, WindowObserver implementation: 542 // WindowEventDispatcher, WindowObserver implementation:
545 543
546 void WindowEventDispatcher::OnWindowDestroying(Window* window) { 544 void WindowEventDispatcher::OnWindowDestroying(Window* window) {
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 } 907 }
910 908
911 // This flag is set depending on the gestures recognized in the call above, 909 // This flag is set depending on the gestures recognized in the call above,
912 // and needs to propagate with the forwarded event. 910 // and needs to propagate with the forwarded event.
913 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); 911 event->set_may_cause_scrolling(orig_event.may_cause_scrolling());
914 912
915 return PreDispatchLocatedEvent(target, event); 913 return PreDispatchLocatedEvent(target, event);
916 } 914 }
917 915
918 } // namespace aura 916 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_event_dispatcher.h ('k') | ui/events/gesture_detection/gesture_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698