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_WINDOW_RESIZER_H_ | 5 #ifndef ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ |
6 #define ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ | 6 #define ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 | 14 |
15 namespace aura { | 15 namespace aura { |
16 class RootWindow; | 16 class RootWindow; |
17 } // namespace aura | 17 } // namespace aura |
18 | 18 |
| 19 namespace ui { |
| 20 class Layer; |
| 21 } // namespace ui |
| 22 |
19 namespace ash { | 23 namespace ash { |
20 namespace internal { | 24 namespace internal { |
21 | 25 |
22 class PhantomWindowController; | 26 class PhantomWindowController; |
23 class SnapSizer; | 27 class SnapSizer; |
24 | 28 |
25 // WindowResizer implementation for workspaces. This enforces that windows are | 29 // WindowResizer implementation for workspaces. This enforces that windows are |
26 // not allowed to vertically move or resize outside of the work area. As windows | 30 // not allowed to vertically move or resize outside of the work area. As windows |
27 // are moved outside the work area they are shrunk. We remember the height of | 31 // are moved outside the work area they are shrunk. We remember the height of |
28 // the window before it was moved so that if the window is again moved up we | 32 // the window before it was moved so that if the window is again moved up we |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // top of the z-order, and the rest directly underneath it. | 129 // top of the z-order, and the rest directly underneath it. |
126 void RestackWindows(); | 130 void RestackWindows(); |
127 | 131 |
128 // Returns the SnapType for the specified point. SNAP_NONE is used if no | 132 // Returns the SnapType for the specified point. SNAP_NONE is used if no |
129 // snapping should be used. | 133 // snapping should be used. |
130 SnapType GetSnapType(const gfx::Point& location) const; | 134 SnapType GetSnapType(const gfx::Point& location) const; |
131 | 135 |
132 // Returns true if we should allow the mouse pointer to warp. | 136 // Returns true if we should allow the mouse pointer to warp. |
133 bool ShouldAllowMouseWarp() const; | 137 bool ShouldAllowMouseWarp() const; |
134 | 138 |
| 139 // Recreates a fresh layer for window() and all its child windows. |
| 140 void RecreateWindowLayers(); |
| 141 |
135 aura::Window* window() const { return details_.window; } | 142 aura::Window* window() const { return details_.window; } |
136 | 143 |
137 const Details details_; | 144 const Details details_; |
138 | 145 |
139 const std::vector<aura::Window*> attached_windows_; | 146 const std::vector<aura::Window*> attached_windows_; |
140 | 147 |
141 // Set to true once Drag() is invoked and the bounds of the window change. | 148 // Set to true once Drag() is invoked and the bounds of the window change. |
142 bool did_move_or_resize_; | 149 bool did_move_or_resize_; |
143 | 150 |
144 // The initial size of each of the windows in |attached_windows_| along the | 151 // The initial size of each of the windows in |attached_windows_| along the |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 SnapType snap_type_; | 186 SnapType snap_type_; |
180 | 187 |
181 // Number of mouse moves since the last bounds change. Only used for phantom | 188 // Number of mouse moves since the last bounds change. Only used for phantom |
182 // placement to track when the mouse is moved while pushed against the edge of | 189 // placement to track when the mouse is moved while pushed against the edge of |
183 // the screen. | 190 // the screen. |
184 int num_mouse_moves_since_bounds_change_; | 191 int num_mouse_moves_since_bounds_change_; |
185 | 192 |
186 // The mouse location passed to Drag(). | 193 // The mouse location passed to Drag(). |
187 gfx::Point last_mouse_location_; | 194 gfx::Point last_mouse_location_; |
188 | 195 |
| 196 // The copy of window()->layer() and its children. This object is the owner of |
| 197 // the layer. |
| 198 ui::Layer* layer_; |
| 199 |
189 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); | 200 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); |
190 }; | 201 }; |
191 | 202 |
192 } // namespace internal | 203 } // namespace internal |
193 } // namespace ash | 204 } // namespace ash |
194 | 205 |
195 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ | 206 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ |
OLD | NEW |