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 #include "ash/wm/overview/overview_window_targeter.h" |
| 6 #include "ui/aura/window.h" |
| 7 |
| 8 namespace ash { |
| 9 |
| 10 OverviewWindowTargeter::OverviewWindowTargeter(aura::Window* target) |
| 11 : bounds_(gfx::Rect()), target_(target) { |
| 12 } |
| 13 |
| 14 OverviewWindowTargeter::~OverviewWindowTargeter() { |
| 15 } |
| 16 |
| 17 ui::EventTarget* OverviewWindowTargeter::FindTargetForLocatedEvent( |
| 18 ui::EventTarget* target, |
| 19 ui::LocatedEvent* event) { |
| 20 // Manually override the location of the event to make sure it targets the |
| 21 // contents view on the target window. |
| 22 event->set_location(gfx::PointF(0, 0)); |
| 23 return target_; |
| 24 } |
| 25 |
| 26 bool OverviewWindowTargeter::EventLocationInsideBounds( |
| 27 ui::EventTarget* target, |
| 28 const ui::LocatedEvent& event) const { |
| 29 return bounds_.Contains(event.location()); |
| 30 } |
| 31 |
| 32 } // namespace ash |
OLD | NEW |