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

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

Issue 2836073003: Fix an interactive ui test (Closed)
Patch Set: Remove touch drag from the test Created 3 years, 8 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/test/ui_controls_factory_ozone.cc ('k') | no next file » | 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 ui::GestureRecognizer::Gestures gestures) { 302 ui::GestureRecognizer::Gestures gestures) {
303 DispatchDetails details; 303 DispatchDetails details;
304 if (gestures.empty()) 304 if (gestures.empty())
305 return details; 305 return details;
306 306
307 // If a window has been hidden between the touch event and now, the associated 307 // If a window has been hidden between the touch event and now, the associated
308 // gestures may not have a valid target. 308 // gestures may not have a valid target.
309 if (!target) 309 if (!target)
310 return details; 310 return details;
311 311
312 WindowEventDispatcher* dispatcher = this;
312 for (const auto& event : gestures) { 313 for (const auto& event : gestures) {
313 event->ConvertLocationToTarget(window(), target); 314 event->ConvertLocationToTarget(dispatcher->window(), target);
314 details = DispatchEvent(target, event.get()); 315 details = dispatcher->DispatchEvent(target, event.get());
315 if (details.dispatcher_destroyed || details.target_destroyed) 316 if (details.dispatcher_destroyed || details.target_destroyed)
316 break; 317 break;
318 // If the target window has moved off to a different WindowTreeHost, then
319 // reroute them to the right place.
320 if (!dispatcher->window()->Contains(target))
321 dispatcher = target->GetHost()->dispatcher();
sadrul 2017/04/27 02:33:31 We should no longer need this change. If you want
weidongg 2017/04/27 03:07:32 Sure, I could leave this file untouched, as Window
317 } 322 }
318 return details; 323 return details;
319 } 324 }
320 325
321 void WindowEventDispatcher::OnWindowHidden(Window* invisible, 326 void WindowEventDispatcher::OnWindowHidden(Window* invisible,
322 WindowHiddenReason reason) { 327 WindowHiddenReason reason) {
323 // If the window the mouse was pressed in becomes invisible, it should no 328 // If the window the mouse was pressed in becomes invisible, it should no
324 // longer receive mouse events. 329 // longer receive mouse events.
325 if (invisible->Contains(mouse_pressed_handler_)) 330 if (invisible->Contains(mouse_pressed_handler_))
326 mouse_pressed_handler_ = NULL; 331 mouse_pressed_handler_ = NULL;
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 } 926 }
922 927
923 // This flag is set depending on the gestures recognized in the call above, 928 // This flag is set depending on the gestures recognized in the call above,
924 // and needs to propagate with the forwarded event. 929 // and needs to propagate with the forwarded event.
925 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); 930 event->set_may_cause_scrolling(orig_event.may_cause_scrolling());
926 931
927 return PreDispatchLocatedEvent(target, event); 932 return PreDispatchLocatedEvent(target, event);
928 } 933 }
929 934
930 } // namespace aura 935 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/ui_controls_factory_ozone.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698