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 #include "ui/aura/aura_export.h" |
5 #include "ui/events/event_targeter.h" | 6 #include "ui/events/event_targeter.h" |
6 | 7 |
7 namespace aura { | 8 namespace aura { |
8 | 9 |
9 class Window; | 10 class Window; |
10 | 11 |
11 class WindowTargeter : public ui::EventTargeter { | 12 class AURA_EXPORT WindowTargeter : public ui::EventTargeter { |
12 public: | 13 public: |
13 WindowTargeter(); | 14 WindowTargeter(); |
14 virtual ~WindowTargeter(); | 15 virtual ~WindowTargeter(); |
15 | 16 |
16 protected: | 17 protected: |
| 18 bool WindowCanAcceptEvent(aura::Window* window, |
| 19 const ui::LocatedEvent& event) const; |
| 20 |
| 21 // Returns whether the location of the event is in an actionable region of the |
| 22 // window. Note that the location etc. of |event| is in the |window|'s |
| 23 // parent's coordinate system. |
| 24 virtual bool EventLocationInsideBounds(aura::Window* window, |
| 25 const ui::LocatedEvent& event) const; |
| 26 |
17 // ui::EventTargeter: | 27 // ui::EventTargeter: |
18 virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, | 28 virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, |
19 ui::Event* event) OVERRIDE; | 29 ui::Event* event) OVERRIDE; |
20 virtual ui::EventTarget* FindTargetForLocatedEvent( | 30 virtual ui::EventTarget* FindTargetForLocatedEvent( |
21 ui::EventTarget* root, | 31 ui::EventTarget* root, |
22 ui::LocatedEvent* event) OVERRIDE; | 32 ui::LocatedEvent* event) OVERRIDE; |
23 virtual bool SubtreeShouldBeExploredForEvent( | 33 virtual bool SubtreeShouldBeExploredForEvent( |
24 ui::EventTarget* target, | 34 ui::EventTarget* target, |
25 const ui::LocatedEvent& event) OVERRIDE; | 35 const ui::LocatedEvent& event) OVERRIDE; |
26 | 36 |
27 private: | 37 private: |
28 Window* FindTargetInRootWindow(Window* root_window, | 38 Window* FindTargetInRootWindow(Window* root_window, |
29 const ui::LocatedEvent& event); | 39 const ui::LocatedEvent& event); |
30 | 40 |
31 DISALLOW_COPY_AND_ASSIGN(WindowTargeter); | 41 DISALLOW_COPY_AND_ASSIGN(WindowTargeter); |
32 }; | 42 }; |
33 | 43 |
34 } // namespace aura | 44 } // namespace aura |
OLD | NEW |