Chromium Code Reviews| Index: ash/wm/overview/overview_window_targeter.h |
| diff --git a/ash/wm/overview/overview_window_targeter.h b/ash/wm/overview/overview_window_targeter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b6f9e5b86dc348d869c78cd871f3c15565b7197c |
| --- /dev/null |
| +++ b/ash/wm/overview/overview_window_targeter.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_ |
| +#define ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_ |
| + |
| +#include "ui/aura/window_targeter.h" |
| +#include "ui/gfx/geometry/rect.h" |
| + |
| +namespace ash { |
| + |
| +// A targeter for the windows in the overview. Avoids propagating events to |
| +// window children and uses the WindowSelectorItem bounds to check for hits. |
| +class OverviewWindowTargeter : public aura::WindowTargeter { |
| + public: |
| + explicit OverviewWindowTargeter(aura::Window* target); |
| + |
| + ~OverviewWindowTargeter() override; |
| + |
| + // Sets the targetable bounds. |
| + void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; } |
| + |
| + // ui::EventTargeter: |
| + ui::EventTarget* FindTargetForLocatedEvent(ui::EventTarget* target, |
| + ui::LocatedEvent* event) override; |
| + |
| + protected: |
| + 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.
|
| + const ui::LocatedEvent& event) const override; |
| + |
| + private: |
| + // Bounds used to check for event hits in the root window coordinates. |
| + gfx::Rect bounds_; |
| + |
| + // Target to which events are redirected. |
| + aura::Window* target_; |
| +}; |
|
flackr
2015/01/22 23:21:17
DISALLOW_COPY_AND_ASSIGN
Nina
2015/01/23 18:38:58
Done.
|
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_WM_OVERVIEW_OVERVIEW_WINDOW_TARGETER_H_ |