| 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/workspace/multi_window_resize_controller.h" | 8 #include "ash/wm/workspace/multi_window_resize_controller.h" |
| 9 #include "ui/events/event_handler.h" | 9 #include "ui/events/event_handler.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 class WorkspaceEventHandlerTestHelper; | 12 class WorkspaceEventHandlerTestHelper; |
| 13 | 13 |
| 14 namespace wm { | 14 namespace wm { |
| 15 class WindowState; | 15 class WindowState; |
| 16 } | 16 } |
| 17 | 17 |
| 18 class WorkspaceEventHandler : public ui::EventHandler { | 18 class WorkspaceEventHandler : public ui::EventHandler { |
| 19 public: | 19 public: |
| 20 WorkspaceEventHandler(); | 20 WorkspaceEventHandler(); |
| 21 virtual ~WorkspaceEventHandler(); | 21 virtual ~WorkspaceEventHandler(); |
| 22 | 22 |
| 23 // ui::EventHandler: | 23 // ui::EventHandler: |
| 24 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; | 24 virtual void OnMouseEvent(ui::MouseEvent* event) override; |
| 25 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 25 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 friend class WorkspaceEventHandlerTestHelper; | 28 friend class WorkspaceEventHandlerTestHelper; |
| 29 | 29 |
| 30 // Determines if |event| corresponds to a double click on either the top or | 30 // Determines if |event| corresponds to a double click on either the top or |
| 31 // bottom vertical resize edge, and if so toggles the vertical height of the | 31 // bottom vertical resize edge, and if so toggles the vertical height of the |
| 32 // window between its restored state and the full available height of the | 32 // window between its restored state and the full available height of the |
| 33 // workspace. | 33 // workspace. |
| 34 void HandleVerticalResizeDoubleClick(wm::WindowState* window_state, | 34 void HandleVerticalResizeDoubleClick(wm::WindowState* window_state, |
| 35 ui::MouseEvent* event); | 35 ui::MouseEvent* event); |
| 36 | 36 |
| 37 MultiWindowResizeController multi_window_resize_controller_; | 37 MultiWindowResizeController multi_window_resize_controller_; |
| 38 | 38 |
| 39 // The non-client component for the target of a MouseEvent or GestureEvent. | 39 // The non-client component for the target of a MouseEvent or GestureEvent. |
| 40 // Events can be destructive to the window tree, which can cause the | 40 // Events can be destructive to the window tree, which can cause the |
| 41 // component of a ui::EF_IS_DOUBLE_CLICK event to no longer be the same as | 41 // component of a ui::EF_IS_DOUBLE_CLICK event to no longer be the same as |
| 42 // that of the initial click. Acting on a double click should only occur for | 42 // that of the initial click. Acting on a double click should only occur for |
| 43 // matching components. This will be set for left clicks, and tap events. | 43 // matching components. This will be set for left clicks, and tap events. |
| 44 int click_component_; | 44 int click_component_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(WorkspaceEventHandler); | 46 DISALLOW_COPY_AND_ASSIGN(WorkspaceEventHandler); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace ash | 49 } // namespace ash |
| 50 | 50 |
| 51 #endif // ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ | 51 #endif // ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_ |
| OLD | NEW |