| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef UI_AURA_WINDOW_TARGETER_H_ | 5 #ifndef UI_AURA_WINDOW_TARGETER_H_ |
| 6 #define UI_AURA_WINDOW_TARGETER_H_ | 6 #define UI_AURA_WINDOW_TARGETER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/aura/aura_export.h" | 9 #include "ui/aura/aura_export.h" |
| 10 #include "ui/events/event_targeter.h" | 10 #include "ui/events/event_targeter.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 class KeyEvent; | 13 class KeyEvent; |
| 14 class LocatedEvent; | 14 class LocatedEvent; |
| 15 } // namespace ui | 15 } // namespace ui |
| 16 | 16 |
| 17 namespace gfx { |
| 18 class Point; |
| 19 } // namespace gfx |
| 20 |
| 17 namespace aura { | 21 namespace aura { |
| 18 | 22 |
| 19 class Window; | 23 class Window; |
| 20 | 24 |
| 21 class AURA_EXPORT WindowTargeter : public ui::EventTargeter { | 25 class AURA_EXPORT WindowTargeter : public ui::EventTargeter { |
| 22 public: | 26 public: |
| 23 WindowTargeter(); | 27 WindowTargeter(); |
| 24 ~WindowTargeter() override; | 28 ~WindowTargeter() override; |
| 25 | 29 |
| 26 // Returns true if |window| or one of its descendants can be a target of | 30 // Returns true if |window| or one of its descendants can be a target of |
| (...skipping 26 matching lines...) Expand all Loading... |
| 53 // parent's coordinate system. | 57 // parent's coordinate system. |
| 54 virtual bool EventLocationInsideBounds(Window* target, | 58 virtual bool EventLocationInsideBounds(Window* target, |
| 55 const ui::LocatedEvent& event) const; | 59 const ui::LocatedEvent& event) const; |
| 56 | 60 |
| 57 // ui::EventTargeter: | 61 // ui::EventTargeter: |
| 58 ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, | 62 ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, |
| 59 ui::Event* event) override; | 63 ui::Event* event) override; |
| 60 ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target, | 64 ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target, |
| 61 ui::Event* event) override; | 65 ui::Event* event) override; |
| 62 | 66 |
| 67 // Returns whether the location of the event is in an actionable region of |
| 68 // |window| or of any of its children. Does not assume that children are |
| 69 // restricted to the bounds of their modal parent windows. Note that |point| |
| 70 // is in |window|'s parent's coordinate system and |location| is the original |
| 71 // event location. |
| 72 bool EventLocationInsideBoundsRecursive(Window* window, |
| 73 gfx::Point point, |
| 74 gfx::Point location); |
| 75 |
| 63 private: | 76 private: |
| 64 Window* FindTargetForKeyEvent(Window* root_window, const ui::KeyEvent& event); | 77 Window* FindTargetForKeyEvent(Window* root_window, const ui::KeyEvent& event); |
| 65 Window* FindTargetForNonKeyEvent(Window* root_window, ui::Event* event); | 78 Window* FindTargetForNonKeyEvent(Window* root_window, ui::Event* event); |
| 66 Window* FindTargetInRootWindow(Window* root_window, | 79 Window* FindTargetInRootWindow(Window* root_window, |
| 67 const ui::LocatedEvent& event); | 80 const ui::LocatedEvent& event); |
| 68 Window* FindTargetForLocatedEventRecursively(Window* root_window, | 81 Window* FindTargetForLocatedEventRecursively(Window* root_window, |
| 69 ui::LocatedEvent* event); | 82 ui::LocatedEvent* event); |
| 70 | 83 |
| 71 DISALLOW_COPY_AND_ASSIGN(WindowTargeter); | 84 DISALLOW_COPY_AND_ASSIGN(WindowTargeter); |
| 72 }; | 85 }; |
| 73 | 86 |
| 74 } // namespace aura | 87 } // namespace aura |
| 75 | 88 |
| 76 #endif // UI_AURA_WINDOW_TARGETER_H_ | 89 #endif // UI_AURA_WINDOW_TARGETER_H_ |
| OLD | NEW |