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

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

Issue 450413002: Do not dispatch gestures to a NULL aura::Window target (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test added Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/aura/window_event_dispatcher_unittest.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 "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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 return DispatchEvent(mouse_moved_handler_, &translated_event); 278 return DispatchEvent(mouse_moved_handler_, &translated_event);
279 } 279 }
280 280
281 ui::EventDispatchDetails WindowEventDispatcher::ProcessGestures( 281 ui::EventDispatchDetails WindowEventDispatcher::ProcessGestures(
282 ui::GestureRecognizer::Gestures* gestures) { 282 ui::GestureRecognizer::Gestures* gestures) {
283 DispatchDetails details; 283 DispatchDetails details;
284 if (!gestures || gestures->empty()) 284 if (!gestures || gestures->empty())
285 return details; 285 return details;
286 286
287 Window* target = GetGestureTarget(gestures->get().at(0)); 287 Window* target = GetGestureTarget(gestures->get().at(0));
288 if (!target)
289 return details;
290
288 for (size_t i = 0; i < gestures->size(); ++i) { 291 for (size_t i = 0; i < gestures->size(); ++i) {
289 ui::GestureEvent* event = gestures->get().at(i); 292 ui::GestureEvent* event = gestures->get().at(i);
290 event->ConvertLocationToTarget(window(), target); 293 event->ConvertLocationToTarget(window(), target);
291 details = DispatchEvent(target, event); 294 details = DispatchEvent(target, event);
292 if (details.dispatcher_destroyed || details.target_destroyed) 295 if (details.dispatcher_destroyed || details.target_destroyed)
293 break; 296 break;
294 } 297 }
295 return details; 298 return details;
296 } 299 }
297 300
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event, 894 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event,
892 target)) { 895 target)) {
893 event->SetHandled(); 896 event->SetHandled();
894 } 897 }
895 } 898 }
896 899
897 PreDispatchLocatedEvent(target, event); 900 PreDispatchLocatedEvent(target, event);
898 } 901 }
899 902
900 } // namespace aura 903 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698