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_HANDLER_H_ | 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ |
6 #define ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ | 6 #define ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ |
7 | 7 |
8 #include "ash/wm/toplevel_window_event_handler.h" | |
9 #include "ash/wm/workspace/multi_window_resize_controller.h" | 8 #include "ash/wm/workspace/multi_window_resize_controller.h" |
10 | 9 #include "ui/events/event_handler.h" |
11 namespace aura { | |
12 class Window; | |
13 } | |
14 | 10 |
15 namespace ash { | 11 namespace ash { |
16 namespace wm { | 12 namespace wm { |
17 class WindowState; | 13 class WindowState; |
18 } | 14 } |
19 | 15 |
20 namespace internal { | 16 namespace internal { |
21 | 17 |
22 class WorkspaceEventHandlerTestHelper; | 18 class WorkspaceEventHandlerTestHelper; |
23 | 19 |
24 class WorkspaceEventHandler : public ToplevelWindowEventHandler { | 20 class WorkspaceEventHandler : public ui::EventHandler { |
25 public: | 21 public: |
26 explicit WorkspaceEventHandler(aura::Window* owner); | 22 WorkspaceEventHandler(); |
27 virtual ~WorkspaceEventHandler(); | 23 virtual ~WorkspaceEventHandler(); |
28 | 24 |
29 // Overridden from ToplevelWindowEventHandler: | 25 // Overridden from ui::EventHandler: |
varkha
2013/12/13 04:05:14
nit: I think the style I was advised to use was "/
| |
30 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; | 26 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; |
31 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 27 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
32 | 28 |
33 private: | 29 private: |
34 friend class WorkspaceEventHandlerTestHelper; | 30 friend class WorkspaceEventHandlerTestHelper; |
35 | 31 |
36 // Determines if |event| corresponds to a double click on either the top or | 32 // Determines if |event| corresponds to a double click on either the top or |
37 // bottom vertical resize edge, and if so toggles the vertical height of the | 33 // bottom vertical resize edge, and if so toggles the vertical height of the |
38 // window between its restored state and the full available height of the | 34 // window between its restored state and the full available height of the |
39 // workspace. | 35 // workspace. |
40 void HandleVerticalResizeDoubleClick(wm::WindowState* window_state, | 36 void HandleVerticalResizeDoubleClick(wm::WindowState* window_state, |
41 ui::MouseEvent* event); | 37 ui::MouseEvent* event); |
42 | 38 |
43 MultiWindowResizeController multi_window_resize_controller_; | 39 MultiWindowResizeController multi_window_resize_controller_; |
44 | 40 |
45 // If non-NULL, set to true in the destructor. | |
46 bool* destroyed_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(WorkspaceEventHandler); | 41 DISALLOW_COPY_AND_ASSIGN(WorkspaceEventHandler); |
49 }; | 42 }; |
50 | 43 |
51 } // namespace internal | 44 } // namespace internal |
52 } // namespace ash | 45 } // namespace ash |
53 | 46 |
54 #endif // ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ | 47 #endif // ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ |
OLD | NEW |