Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: ui/aura/window_targeter.h

Issue 2681613002: Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)
Patch Set: early return Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | ui/aura/window_tree_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | ui/aura/window_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698