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_COMMON_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 5 #ifndef ASH_WM_COMMON_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
6 #define ASH_WM_COMMON_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 6 #define ASH_WM_COMMON_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/wm/common/ash_wm_common_export.h" | 11 #include "ash/ash_export.h" |
12 #include "ash/wm/common/wm_window_observer.h" | 12 #include "ash/wm/common/wm_window_observer.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/views/mouse_watcher.h" | 16 #include "ui/views/mouse_watcher.h" |
17 | 17 |
18 namespace views { | 18 namespace views { |
19 class Widget; | 19 class Widget; |
20 } | 20 } |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
23 class MultiWindowResizeControllerTest; | 23 class MultiWindowResizeControllerTest; |
24 class WorkspaceWindowResizer; | 24 class WorkspaceWindowResizer; |
25 | 25 |
26 // Two directions resizes happen in. | 26 // Two directions resizes happen in. |
27 enum Direction { | 27 enum Direction { |
28 TOP_BOTTOM, | 28 TOP_BOTTOM, |
29 LEFT_RIGHT, | 29 LEFT_RIGHT, |
30 }; | 30 }; |
31 | 31 |
32 // MultiWindowResizeController is responsible for determining and showing a | 32 // MultiWindowResizeController is responsible for determining and showing a |
33 // widget that allows resizing multiple windows at the same time. | 33 // widget that allows resizing multiple windows at the same time. |
34 // MultiWindowResizeController is driven by WorkspaceEventFilter. | 34 // MultiWindowResizeController is driven by WorkspaceEventFilter. |
35 class ASH_WM_COMMON_EXPORT MultiWindowResizeController | 35 class ASH_EXPORT MultiWindowResizeController |
36 : public views::MouseWatcherListener, | 36 : public views::MouseWatcherListener, |
37 public wm::WmWindowObserver { | 37 public wm::WmWindowObserver { |
38 public: | 38 public: |
39 MultiWindowResizeController(); | 39 MultiWindowResizeController(); |
40 ~MultiWindowResizeController() override; | 40 ~MultiWindowResizeController() override; |
41 | 41 |
42 // If necessary, shows the resize widget. |window| is the window the mouse | 42 // If necessary, shows the resize widget. |window| is the window the mouse |
43 // is over, |component| the edge and |point| the location of the mouse. | 43 // is over, |component| the edge and |point| the location of the mouse. |
44 void Show(wm::WmWindow* window, int component, const gfx::Point& point); | 44 void Show(wm::WmWindow* window, int component, const gfx::Point& point); |
45 | 45 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // |resize_widget_| is non-NULL (ie the widget is showing) we ignore calls | 171 // |resize_widget_| is non-NULL (ie the widget is showing) we ignore calls |
172 // to Show(). | 172 // to Show(). |
173 std::unique_ptr<views::MouseWatcher> mouse_watcher_; | 173 std::unique_ptr<views::MouseWatcher> mouse_watcher_; |
174 | 174 |
175 DISALLOW_COPY_AND_ASSIGN(MultiWindowResizeController); | 175 DISALLOW_COPY_AND_ASSIGN(MultiWindowResizeController); |
176 }; | 176 }; |
177 | 177 |
178 } // namespace ash | 178 } // namespace ash |
179 | 179 |
180 #endif // ASH_WM_COMMON_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 180 #endif // ASH_WM_COMMON_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
OLD | NEW |