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_SHELL_DEFAULT_CONTAINER_EVENT_FILTER_H_ | |
6 #define UI_AURA_SHELL_DEFAULT_CONTAINER_EVENT_FILTER_H_ | |
7 #pragma once | |
8 | |
9 #include "ui/aura_shell/toplevel_window_event_filter.h" | |
10 | |
11 namespace aura { | |
12 class MouseEvent; | |
13 class Window; | |
14 } | |
15 | |
16 namespace aura_shell { | |
17 namespace internal { | |
18 | |
19 class DefaultContainerEventFilter : public ToplevelWindowEventFilter { | |
20 public: | |
21 explicit DefaultContainerEventFilter(aura::Window* owner); | |
22 virtual ~DefaultContainerEventFilter(); | |
23 | |
24 // Overridden from ToplevelWindowEventFilter: | |
25 virtual bool PreHandleMouseEvent(aura::Window* target, | |
26 aura::MouseEvent* event) OVERRIDE; | |
27 | |
28 private: | |
29 enum DragState { | |
30 DRAG_NONE, | |
31 DRAG_MOVE, | |
32 DRAG_RESIZE | |
33 }; | |
34 | |
35 // If the mouse is currently over a portion of the window that should | |
36 // trigger a drag or resize, drag_state_ is set appropriately and true | |
37 // is returned. If the mouse is not over a portion of the window that should | |
38 // trigger a more or resize, drag_state_ is not updated and false is returend. | |
39 bool UpdateDragState(); | |
40 | |
41 // Updates the top-level window under the mouse so that we can change | |
42 // the look of the caption area based on mouse-hover. | |
43 void UpdateHoveredWindow(aura::Window* toplevel); | |
44 | |
45 DragState drag_state_; | |
46 // Top-level window under the mouse cursor. | |
47 aura::Window* hovered_window_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(DefaultContainerEventFilter); | |
50 }; | |
51 | |
52 } // namespace internal | |
53 } // namespace aura_shell | |
54 | |
55 #endif // UI_AURA_SHELL_DEFAULT_CONTAINER_EVENT_FILTER_H_ | |
OLD | NEW |