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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 ~WindowTargeter() override; | 24 ~WindowTargeter() override; |
25 | 25 |
26 // Returns true if |window| or one of its descendants can be a target of | 26 // Returns true if |window| or one of its descendants can be a target of |
27 // |event|. This requires that |window| and its descendants are not | 27 // |event|. This requires that |window| and its descendants are not |
28 // prohibited from accepting the event, and that the event is within an | 28 // prohibited from accepting the event, and that the event is within an |
29 // actionable region of the target's bounds. Note that the location etc. of | 29 // actionable region of the target's bounds. Note that the location etc. of |
30 // |event| is in |window|'s parent's coordinate system. | 30 // |event| is in |window|'s parent's coordinate system. |
31 virtual bool SubtreeShouldBeExploredForEvent(Window* window, | 31 virtual bool SubtreeShouldBeExploredForEvent(Window* window, |
32 const ui::LocatedEvent& event); | 32 const ui::LocatedEvent& event); |
33 | 33 |
| 34 Window* FindTargetInRootWindow(Window* root_window, |
| 35 const ui::LocatedEvent& event); |
| 36 |
34 protected: | 37 protected: |
35 // Same as FindTargetForEvent(), but used for positional events. The location | 38 // Same as FindTargetForEvent(), but used for positional events. The location |
36 // etc. of |event| are in |root|'s coordinate system. When finding the target | 39 // etc. of |event| are in |root|'s coordinate system. When finding the target |
37 // for the event, the targeter can mutate the |event| (e.g. change the | 40 // for the event, the targeter can mutate the |event| (e.g. change the |
38 // coordinate to be in the returned target's coordinate system) so that it can | 41 // coordinate to be in the returned target's coordinate system) so that it can |
39 // be dispatched to the target without any further modification. | 42 // be dispatched to the target without any further modification. |
40 virtual Window* FindTargetForLocatedEvent(Window* window, | 43 virtual Window* FindTargetForLocatedEvent(Window* window, |
41 ui::LocatedEvent* event); | 44 ui::LocatedEvent* event); |
42 | 45 |
43 // Returns false if neither |window| nor any of its descendants are allowed | 46 // Returns false if neither |window| nor any of its descendants are allowed |
(...skipping 12 matching lines...) Expand all Loading... |
56 | 59 |
57 // ui::EventTargeter: | 60 // ui::EventTargeter: |
58 ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, | 61 ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, |
59 ui::Event* event) override; | 62 ui::Event* event) override; |
60 ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target, | 63 ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target, |
61 ui::Event* event) override; | 64 ui::Event* event) override; |
62 | 65 |
63 private: | 66 private: |
64 Window* FindTargetForKeyEvent(Window* root_window, const ui::KeyEvent& event); | 67 Window* FindTargetForKeyEvent(Window* root_window, const ui::KeyEvent& event); |
65 Window* FindTargetForNonKeyEvent(Window* root_window, ui::Event* event); | 68 Window* FindTargetForNonKeyEvent(Window* root_window, ui::Event* event); |
66 Window* FindTargetInRootWindow(Window* root_window, | |
67 const ui::LocatedEvent& event); | |
68 Window* FindTargetForLocatedEventRecursively(Window* root_window, | 69 Window* FindTargetForLocatedEventRecursively(Window* root_window, |
69 ui::LocatedEvent* event); | 70 ui::LocatedEvent* event); |
70 | 71 |
71 DISALLOW_COPY_AND_ASSIGN(WindowTargeter); | 72 DISALLOW_COPY_AND_ASSIGN(WindowTargeter); |
72 }; | 73 }; |
73 | 74 |
74 } // namespace aura | 75 } // namespace aura |
75 | 76 |
76 #endif // UI_AURA_WINDOW_TARGETER_H_ | 77 #endif // UI_AURA_WINDOW_TARGETER_H_ |
OLD | NEW |