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 // ui::EventTargeter: |
| 30 bool EventLocationInsideBounds(ui::EventTarget* target, |
| 31 const ui::LocatedEvent& event) const override; |
| 32 |
| 33 private: |
| 34 // Bounds used to check for event hits in the root window coordinates. |
| 35 gfx::Rect bounds_; |
| 36 |
| 37 // Target to which events are redirected. |
| 38 aura::Window* target_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(OverviewWindowTargeter); |
| 41 }; |
| 42 |
| 43 } // namespace ash |
| 44 |
| 45 #endif // ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_ |
OLD | NEW |