OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_ | |
6 #define ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_ | |
7 | |
8 #include "ui/aura/window_targeter.h" | |
9 #include "ui/gfx/geometry/rect.h" | |
10 | |
11 namespace ash { | |
12 | |
13 // A targeter for the windows in the overview. Avoids propagating events to | |
14 // window children and uses the WindowSelectorItem bounds to check for hits. | |
15 class OverviewWindowTargeter : public aura::WindowTargeter { | |
16 public: | |
17 explicit OverviewWindowTargeter(aura::Window* target); | |
18 | |
19 ~OverviewWindowTargeter() override; | |
20 | |
21 // Sets the targetable bounds. | |
22 void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; } | |
23 | |
24 // ui::EventTargeter: | |
25 ui::EventTarget* FindTargetForLocatedEvent(ui::EventTarget* target, | |
26 ui::LocatedEvent* event) override; | |
27 | |
28 protected: | |
29 bool EventLocationInsideBounds(ui::EventTarget* target, | |
flackr
2015/01/22 23:21:17
can you re-state the parent class which this overr
Nina
2015/01/23 18:38:58
Done.
| |
30 const ui::LocatedEvent& event) const override; | |
31 | |
32 private: | |
33 // Bounds used to check for event hits in the root window coordinates. | |
34 gfx::Rect bounds_; | |
35 | |
36 // Target to which events are redirected. | |
37 aura::Window* target_; | |
38 }; | |
flackr
2015/01/22 23:21:17
DISALLOW_COPY_AND_ASSIGN
Nina
2015/01/23 18:38:58
Done.
| |
39 | |
40 } // namespace ash | |
41 | |
42 #endif // ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_ | |
OLD | NEW |