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

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: Fix Mac. 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.
535 DCHECK(event->type() == ui::ET_TOUCH_CANCELLED);
537 event->UpdateForRootTransform(host_->GetRootTransform()); 536 event->UpdateForRootTransform(host_->GetRootTransform());
538 DispatchDetails details = OnEventFromSource(event); 537 DispatchDetails details = OnEventFromSource(event);
539 if (details.dispatcher_destroyed) 538 if (details.dispatcher_destroyed)
540 return; 539 return;
541 } 540 }
542 541
543 //////////////////////////////////////////////////////////////////////////////// 542 ////////////////////////////////////////////////////////////////////////////////
544 // WindowEventDispatcher, WindowObserver implementation: 543 // WindowEventDispatcher, WindowObserver implementation:
545 544
546 void WindowEventDispatcher::OnWindowDestroying(Window* window) { 545 void WindowEventDispatcher::OnWindowDestroying(Window* window) {
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 } 908 }
910 909
911 // This flag is set depending on the gestures recognized in the call above, 910 // This flag is set depending on the gestures recognized in the call above,
912 // and needs to propagate with the forwarded event. 911 // and needs to propagate with the forwarded event.
913 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); 912 event->set_may_cause_scrolling(orig_event.may_cause_scrolling());
914 913
915 return PreDispatchLocatedEvent(target, event); 914 return PreDispatchLocatedEvent(target, event);
916 } 915 }
917 916
918 } // namespace aura 917 } // 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