OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_EVENT_FILTER_H_ | 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ |
6 #define ASH_WM_WORKSPACE_WORKSPACE_EVENT_FILTER_H_ | 6 #define ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ |
7 | 7 |
8 #include "ash/wm/toplevel_window_event_filter.h" | 8 #include "ash/wm/toplevel_window_event_handler.h" |
9 #include "ash/wm/workspace/multi_window_resize_controller.h" | 9 #include "ash/wm/workspace/multi_window_resize_controller.h" |
10 | 10 |
11 namespace aura { | 11 namespace aura { |
12 class Window; | 12 class Window; |
13 } | 13 } |
14 | 14 |
15 namespace ash { | 15 namespace ash { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 class WorkspaceEventFilterTestHelper; | 18 class WorkspaceEventHandlerTestHelper; |
19 | 19 |
20 class WorkspaceEventFilter : public ToplevelWindowEventFilter { | 20 class WorkspaceEventHandler : public ToplevelWindowEventHandler { |
21 public: | 21 public: |
22 explicit WorkspaceEventFilter(aura::Window* owner); | 22 explicit WorkspaceEventHandler(aura::Window* owner); |
23 virtual ~WorkspaceEventFilter(); | 23 virtual ~WorkspaceEventHandler(); |
24 | 24 |
25 // Overridden from ToplevelWindowEventFilter: | 25 // Overridden from ToplevelWindowEventHandler: |
26 virtual bool PreHandleMouseEvent(aura::Window* target, | 26 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; |
27 ui::MouseEvent* event) OVERRIDE; | 27 virtual ui::EventResult OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
28 virtual ui::EventResult PreHandleGestureEvent( | |
29 aura::Window* target, | |
30 ui::GestureEvent* event) OVERRIDE; | |
31 | 28 |
32 protected: | 29 protected: |
33 // Overridden from ToplevelWindowEventFilter: | 30 // Overridden from ToplevelWindowEventHandler: |
34 virtual WindowResizer* CreateWindowResizer( | 31 virtual WindowResizer* CreateWindowResizer( |
35 aura::Window* window, | 32 aura::Window* window, |
36 const gfx::Point& point_in_parent, | 33 const gfx::Point& point_in_parent, |
37 int window_component) OVERRIDE; | 34 int window_component) OVERRIDE; |
38 | 35 |
39 private: | 36 private: |
40 friend class WorkspaceEventFilterTestHelper; | 37 friend class WorkspaceEventHandlerTestHelper; |
41 | 38 |
42 // Determines if |event| corresponds to a double click on either the top or | 39 // Determines if |event| corresponds to a double click on either the top or |
43 // bottom vertical resize edge, and if so toggles the vertical height of the | 40 // bottom vertical resize edge, and if so toggles the vertical height of the |
44 // window between its restored state and the full available height of the | 41 // window between its restored state and the full available height of the |
45 // workspace. | 42 // workspace. |
46 void HandleVerticalResizeDoubleClick(aura::Window* target, | 43 void HandleVerticalResizeDoubleClick(aura::Window* target, |
47 ui::MouseEvent* event); | 44 ui::MouseEvent* event); |
48 | 45 |
49 MultiWindowResizeController multi_window_resize_controller_; | 46 MultiWindowResizeController multi_window_resize_controller_; |
50 | 47 |
51 // If non-NULL, set to true in the destructor. | 48 // If non-NULL, set to true in the destructor. |
52 bool* destroyed_; | 49 bool* destroyed_; |
53 | 50 |
54 DISALLOW_COPY_AND_ASSIGN(WorkspaceEventFilter); | 51 DISALLOW_COPY_AND_ASSIGN(WorkspaceEventHandler); |
55 }; | 52 }; |
56 | 53 |
57 } // namespace internal | 54 } // namespace internal |
58 } // namespace ash | 55 } // namespace ash |
59 | 56 |
60 #endif // ASH_WM_WORKSPACE_WORKSPACE_EVENT_FILTER_H_ | 57 #endif // ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ |
OLD | NEW |