| 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 <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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 if (event->IsLocatedEvent()) { | 448 if (event->IsLocatedEvent()) { |
| 449 ui::EventTarget* target = event_targeter_->FindTargetInRootWindow( | 449 ui::EventTarget* target = event_targeter_->FindTargetInRootWindow( |
| 450 window(), *event->AsLocatedEvent()); | 450 window(), *event->AsLocatedEvent()); |
| 451 if (target) { | 451 if (target) { |
| 452 ConvertEventLocationToTarget(event_target, target, event); | 452 ConvertEventLocationToTarget(event_target, target, event); |
| 453 return target; | 453 return target; |
| 454 } | 454 } |
| 455 } | 455 } |
| 456 | 456 |
| 457 ui::EventTarget* ancestor_with_targeter = event_target; | 457 ui::EventTarget* ancestor_with_targeter = event_target; |
| 458 for (ui::EventTarget* ancestor = event_target->GetParentTarget(); ancestor; | 458 for (ui::EventTarget* ancestor = event_target; ancestor; |
| 459 ancestor = ancestor->GetParentTarget()) { | 459 ancestor = ancestor->GetParentTarget()) { |
| 460 if (ancestor->GetEventTargeter()) | 460 if (ancestor->GetEventTargeter()) |
| 461 ancestor_with_targeter = ancestor; | 461 ancestor_with_targeter = ancestor; |
| 462 if (ancestor == window()) | 462 if (ancestor == window()) |
| 463 break; | 463 break; |
| 464 } | 464 } |
| 465 ConvertEventLocationToTarget(event_target, ancestor_with_targeter, event); | 465 ConvertEventLocationToTarget(event_target, ancestor_with_targeter, event); |
| 466 return ancestor_with_targeter; | 466 return ancestor_with_targeter; |
| 467 } | 467 } |
| 468 | 468 |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 } | 916 } |
| 917 | 917 |
| 918 // This flag is set depending on the gestures recognized in the call above, | 918 // This flag is set depending on the gestures recognized in the call above, |
| 919 // and needs to propagate with the forwarded event. | 919 // and needs to propagate with the forwarded event. |
| 920 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); | 920 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); |
| 921 | 921 |
| 922 return PreDispatchLocatedEvent(target, event); | 922 return PreDispatchLocatedEvent(target, event); |
| 923 } | 923 } |
| 924 | 924 |
| 925 } // namespace aura | 925 } // namespace aura |
| OLD | NEW |