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_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 5 #ifndef ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
6 #define ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 6 #define ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 MultiWindowResizeController(); | 44 MultiWindowResizeController(); |
45 virtual ~MultiWindowResizeController(); | 45 virtual ~MultiWindowResizeController(); |
46 | 46 |
47 // If necessary, shows the resize widget. |window| is the window the mouse | 47 // If necessary, shows the resize widget. |window| is the window the mouse |
48 // is over, |component| the edge and |point| the location of the mouse. | 48 // is over, |component| the edge and |point| the location of the mouse. |
49 void Show(aura::Window* window, int component, const gfx::Point& point); | 49 void Show(aura::Window* window, int component, const gfx::Point& point); |
50 | 50 |
51 // Hides the resize widget. | 51 // Hides the resize widget. |
52 void Hide(); | 52 void Hide(); |
53 | 53 |
54 void set_grid_size(int grid_size) { grid_size_ = grid_size; } | |
55 | |
56 // MouseWatcherListenre overrides: | 54 // MouseWatcherListenre overrides: |
57 virtual void MouseMovedOutOfHost() OVERRIDE; | 55 virtual void MouseMovedOutOfHost() OVERRIDE; |
58 | 56 |
59 // WindowObserver overrides: | 57 // WindowObserver overrides: |
60 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 58 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
61 | 59 |
62 private: | 60 private: |
63 friend class MultiWindowResizeControllerTest; | 61 friend class MultiWindowResizeControllerTest; |
64 | 62 |
65 // Used to track the two resizable windows and direction. | 63 // Used to track the two resizable windows and direction. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 157 |
160 // If non-null we're in a resize loop. | 158 // If non-null we're in a resize loop. |
161 scoped_ptr<WorkspaceWindowResizer> window_resizer_; | 159 scoped_ptr<WorkspaceWindowResizer> window_resizer_; |
162 | 160 |
163 // Mouse coordinate passed to Show() in container's coodinates. | 161 // Mouse coordinate passed to Show() in container's coodinates. |
164 gfx::Point show_location_in_parent_; | 162 gfx::Point show_location_in_parent_; |
165 | 163 |
166 // Bounds the widget was last shown at in screen coordinates. | 164 // Bounds the widget was last shown at in screen coordinates. |
167 gfx::Rect show_bounds_in_screen_; | 165 gfx::Rect show_bounds_in_screen_; |
168 | 166 |
169 // Size of the grid. | |
170 int grid_size_; | |
171 | |
172 // Used to detect whether the mouse is over the windows. While | 167 // Used to detect whether the mouse is over the windows. While |
173 // |resize_widget_| is non-NULL (ie the widget is showing) we ignore calls | 168 // |resize_widget_| is non-NULL (ie the widget is showing) we ignore calls |
174 // to Show(). | 169 // to Show(). |
175 scoped_ptr<views::MouseWatcher> mouse_watcher_; | 170 scoped_ptr<views::MouseWatcher> mouse_watcher_; |
176 | 171 |
177 DISALLOW_COPY_AND_ASSIGN(MultiWindowResizeController); | 172 DISALLOW_COPY_AND_ASSIGN(MultiWindowResizeController); |
178 }; | 173 }; |
179 | 174 |
180 } // namespace internal | 175 } // namespace internal |
181 } // namespace ash | 176 } // namespace ash |
182 | 177 |
183 #endif // ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 178 #endif // ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
OLD | NEW |