- add sources.
[platform/framework/web/crosswalk.git] / src / ash / wm / workspace / workspace_event_handler.h
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
3 // found in the LICENSE file.
4
5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_
6 #define ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_
7
8 #include "ash/wm/toplevel_window_event_handler.h"
9 #include "ash/wm/workspace/multi_window_resize_controller.h"
10
11 namespace aura {
12 class Window;
13 }
14
15 namespace ash {
16 namespace wm {
17 class WindowState;
18 }
19
20 namespace internal {
21
22 class WorkspaceEventHandlerTestHelper;
23
24 class WorkspaceEventHandler : public ToplevelWindowEventHandler {
25  public:
26   explicit WorkspaceEventHandler(aura::Window* owner);
27   virtual ~WorkspaceEventHandler();
28
29   // Overridden from ToplevelWindowEventHandler:
30   virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
31   virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
32
33  private:
34   friend class WorkspaceEventHandlerTestHelper;
35
36   // 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
38   // window between its restored state and the full available height of the
39   // workspace.
40   void HandleVerticalResizeDoubleClick(wm::WindowState* window_state,
41                                        ui::MouseEvent* event);
42
43   MultiWindowResizeController multi_window_resize_controller_;
44
45   // If non-NULL, set to true in the destructor.
46   bool* destroyed_;
47
48   DISALLOW_COPY_AND_ASSIGN(WorkspaceEventHandler);
49 };
50
51 }  // namespace internal
52 }  // namespace ash
53
54 #endif  // ASH_WM_WORKSPACE_WORKSPACE_EVENT_HANDLER_H_