Chromium Code Reviews| 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. | |
|
tdanderson
2015/01/21 17:24:24
It looks like this targeter can be completely gene
Nina
2015/01/22 19:44:32
Acknowledged.
| |
| 15 class OverviewWindowTargeter : public aura::WindowTargeter { | |
| 16 public: | |
| 17 explicit OverviewWindowTargeter(aura::Window* target); | |
| 18 | |
| 19 ~OverviewWindowTargeter() override; | |
| 20 | |
| 21 // Sets the targetable bounds in the root window coordinates. | |
|
tdanderson
2015/01/21 17:24:24
You should instead mention the coordinate space of
Nina
2015/01/22 19:44:32
Done.
| |
| 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, | |
| 30 const ui::LocatedEvent& event) const override; | |
| 31 | |
| 32 private: | |
| 33 // Bounds used to check for event hits. | |
| 34 gfx::Rect bounds_; | |
| 35 | |
| 36 // Target to which events are redirected. | |
| 37 aura::Window* target_; | |
| 38 }; | |
| 39 | |
| 40 } // namespace ash | |
| 41 | |
| 42 #endif // ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_ | |
| OLD | NEW |