OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |