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" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 virtual aura::Window* GetTarget() OVERRIDE; | 69 virtual aura::Window* GetTarget() OVERRIDE; |
70 virtual const gfx::Point& GetInitialLocation() const OVERRIDE; | 70 virtual const gfx::Point& GetInitialLocation() const OVERRIDE; |
71 | 71 |
72 private: | 72 private: |
73 WorkspaceWindowResizer(const Details& details, | 73 WorkspaceWindowResizer(const Details& details, |
74 const std::vector<aura::Window*>& attached_windows); | 74 const std::vector<aura::Window*>& attached_windows); |
75 | 75 |
76 private: | 76 private: |
77 friend class WorkspaceWindowResizerTest; | 77 friend class WorkspaceWindowResizerTest; |
78 | 78 |
79 // Returns the final bounds to place the window at. This differs from | |
80 // the current when snapping. | |
81 gfx::Rect GetFinalBounds(const gfx::Rect& bounds) const; | |
82 | |
83 // Lays out the attached windows. |bounds| is the bounds of the main window. | 79 // Lays out the attached windows. |bounds| is the bounds of the main window. |
84 void LayoutAttachedWindows(gfx::Rect* bounds); | 80 void LayoutAttachedWindows(gfx::Rect* bounds); |
85 | 81 |
86 // Calculates the new sizes of the attached windows, given that the main | 82 // Calculates the new sizes of the attached windows, given that the main |
87 // window has been resized (along the primary axis) by |delta|. | 83 // window has been resized (along the primary axis) by |delta|. |
88 // |available_size| is the maximum length of the space that the attached | 84 // |available_size| is the maximum length of the space that the attached |
89 // windows are allowed to occupy (ie: the distance between the right/bottom | 85 // windows are allowed to occupy (ie: the distance between the right/bottom |
90 // edge of the primary window and the right/bottom of the desktop area). | 86 // edge of the primary window and the right/bottom of the desktop area). |
91 // Populates |sizes| with the desired sizes of the attached windows, and | 87 // Populates |sizes| with the desired sizes of the attached windows, and |
92 // returns the number of pixels that couldn't be allocated to the attached | 88 // returns the number of pixels that couldn't be allocated to the attached |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // Current instance for use by the WorkspaceWindowResizerTest. | 223 // Current instance for use by the WorkspaceWindowResizerTest. |
228 static WorkspaceWindowResizer* instance_; | 224 static WorkspaceWindowResizer* instance_; |
229 | 225 |
230 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); | 226 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); |
231 }; | 227 }; |
232 | 228 |
233 } // namespace internal | 229 } // namespace internal |
234 } // namespace ash | 230 } // namespace ash |
235 | 231 |
236 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ | 232 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ |
OLD | NEW |