OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 UI_AURA_EVENT_FILTER_H_ |
| 6 #define UI_AURA_EVENT_FILTER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/logging.h" |
| 10 #include "ui/gfx/point.h" |
| 11 |
| 12 namespace aura { |
| 13 |
| 14 class Window; |
| 15 class MouseEvent; |
| 16 |
| 17 // An object that filters events sent to an owner window, potentially performing |
| 18 // adjustments to the window's position, size and z-index. |
| 19 class EventFilter { |
| 20 public: |
| 21 explicit EventFilter(Window* owner); |
| 22 virtual ~EventFilter(); |
| 23 |
| 24 // Try to handle |event| (before the owner's delegate gets a chance to). |
| 25 // Returns true if the event was handled by the WindowManager and should not |
| 26 // be forwarded to the owner's delegate. |
| 27 virtual bool OnMouseEvent(Window* target, MouseEvent* event); |
| 28 |
| 29 protected: |
| 30 Window* owner() { return owner_; } |
| 31 |
| 32 private: |
| 33 Window* owner_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(EventFilter); |
| 36 }; |
| 37 |
| 38 } // namespace aura |
| 39 |
| 40 #endif // UI_AURA_EVENT_FILTER_H_ |
OLD | NEW |