| 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_WINDOW_RESIZER_H_ | 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ | 6 #define ASH_WM_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/wm/window_resizer.h" | 13 #include "ash/wm/window_resizer.h" |
| 14 #include "ash/wm/workspace/magnetism_matcher.h" | 14 #include "ash/wm/workspace/magnetism_matcher.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "ui/aura/window_tracker.h" | 18 #include "ui/aura/window_tracker.h" |
| 19 | 19 |
| 20 namespace ash { | 20 namespace ash { |
| 21 class PhantomWindowController; | 21 class PhantomWindowController; |
| 22 class TwoStepEdgeCycler; | 22 class TwoStepEdgeCycler; |
| 23 class WindowSize; | 23 class WindowSize; |
| 24 class WmShell; | |
| 25 | 24 |
| 26 namespace wm { | 25 namespace wm { |
| 27 class WindowState; | 26 class WindowState; |
| 28 } | 27 } |
| 29 | 28 |
| 30 // WindowResizer implementation for workspaces. This enforces that windows are | 29 // WindowResizer implementation for workspaces. This enforces that windows are |
| 31 // 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 |
| 32 // 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 |
| 33 // 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 |
| 34 // attempt to restore the old height. | 33 // attempt to restore the old height. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 151 |
| 153 // Returns true if |bounds_in_parent| are valid bounds for snapped state type | 152 // Returns true if |bounds_in_parent| are valid bounds for snapped state type |
| 154 // |snapped_type|. | 153 // |snapped_type|. |
| 155 bool AreBoundsValidSnappedBounds(wm::WindowStateType snapped_type, | 154 bool AreBoundsValidSnappedBounds(wm::WindowStateType snapped_type, |
| 156 const gfx::Rect& bounds_in_parent) const; | 155 const gfx::Rect& bounds_in_parent) const; |
| 157 | 156 |
| 158 wm::WindowState* window_state() { return window_state_; } | 157 wm::WindowState* window_state() { return window_state_; } |
| 159 | 158 |
| 160 const std::vector<WmWindow*> attached_windows_; | 159 const std::vector<WmWindow*> attached_windows_; |
| 161 | 160 |
| 162 WmShell* shell_; | |
| 163 | |
| 164 // Returns the currently used instance for test. | 161 // Returns the currently used instance for test. |
| 165 static WorkspaceWindowResizer* GetInstanceForTest(); | 162 static WorkspaceWindowResizer* GetInstanceForTest(); |
| 166 | 163 |
| 167 bool did_lock_cursor_; | 164 bool did_lock_cursor_; |
| 168 | 165 |
| 169 // Set to true once Drag() is invoked and the bounds of the window change. | 166 // Set to true once Drag() is invoked and the bounds of the window change. |
| 170 bool did_move_or_resize_; | 167 bool did_move_or_resize_; |
| 171 | 168 |
| 172 // True if the window initially had |bounds_changed_by_user_| set in state. | 169 // True if the window initially had |bounds_changed_by_user_| set in state. |
| 173 bool initial_bounds_changed_by_user_; | 170 bool initial_bounds_changed_by_user_; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // Used to determine if this has been deleted during a drag such as when a tab | 211 // Used to determine if this has been deleted during a drag such as when a tab |
| 215 // gets dragged into another browser window. | 212 // gets dragged into another browser window. |
| 216 base::WeakPtrFactory<WorkspaceWindowResizer> weak_ptr_factory_; | 213 base::WeakPtrFactory<WorkspaceWindowResizer> weak_ptr_factory_; |
| 217 | 214 |
| 218 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); | 215 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); |
| 219 }; | 216 }; |
| 220 | 217 |
| 221 } // namespace ash | 218 } // namespace ash |
| 222 | 219 |
| 223 #endif // ASH_WM_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ | 220 #endif // ASH_WM_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ |
| OLD | NEW |