Chromium Code Reviews| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 // bitmask of the MagnetismEdges to match again. Returns true if a match is | 127 // bitmask of the MagnetismEdges to match again. Returns true if a match is |
| 128 // found. | 128 // found. |
| 129 bool UpdateMagnetismWindow(const gfx::Rect& bounds, uint32 edges); | 129 bool UpdateMagnetismWindow(const gfx::Rect& bounds, uint32 edges); |
| 130 | 130 |
| 131 // Adjusts the bounds of the window: magnetically snapping, ensuring the | 131 // Adjusts the bounds of the window: magnetically snapping, ensuring the |
| 132 // window has enough on screen... |snap_size| is the distance from an edge of | 132 // window has enough on screen... |snap_size| is the distance from an edge of |
| 133 // the work area before the window is snapped. A value of 0 results in no | 133 // the work area before the window is snapped. A value of 0 results in no |
| 134 // snapping. | 134 // snapping. |
| 135 void AdjustBoundsForMainWindow(int snap_size, gfx::Rect* bounds); | 135 void AdjustBoundsForMainWindow(int snap_size, gfx::Rect* bounds); |
| 136 | 136 |
| 137 // Snaps the window bounds to the work area edges if necessary. | 137 // Snaps the window bounds to the work area edges if necessary. |
|
sky
2013/04/22 17:20:00
If you're goal is to use 'stick' every where, whic
stevenjb
2013/04/22 18:09:41
Done.
| |
| 138 void SnapToWorkAreaEdges( | 138 void StickToWorkAreaEdges(const gfx::Rect& work_area, |
| 139 const gfx::Rect& work_area, | 139 int sticky_size, |
| 140 int snap_size, | 140 gfx::Rect* bounds) const; |
| 141 gfx::Rect* bounds) const; | |
| 142 | 141 |
| 143 // Snaps the window bounds to the work area during a resize. | 142 // Snaps the window bounds to the work area during a resize. |
| 144 void SnapResizeToWorkAreaBounds(const gfx::Rect& work_area, | 143 void StickyResizeToWorkAreaBounds(const gfx::Rect& work_area, |
|
sky
2013/04/22 17:20:00
This name is awkward, maybe StickToWorkAreaBounds?
stevenjb
2013/04/22 18:09:41
Changed to StickToWorkAreaOnResize
| |
| 145 int snap_size, | 144 int sticky_size, |
| 146 gfx::Rect* bounds) const; | 145 gfx::Rect* bounds) const; |
| 147 | 146 |
| 148 // Returns a coordinate along the primary axis. Used to share code for | 147 // Returns a coordinate along the primary axis. Used to share code for |
| 149 // left/right multi window resize and top/bottom resize. | 148 // left/right multi window resize and top/bottom resize. |
| 150 int PrimaryAxisSize(const gfx::Size& size) const; | 149 int PrimaryAxisSize(const gfx::Size& size) const; |
| 151 int PrimaryAxisCoordinate(int x, int y) const; | 150 int PrimaryAxisCoordinate(int x, int y) const; |
| 152 | 151 |
| 153 // Updates the bounds of the phantom window for window snapping. | 152 // Updates the bounds of the phantom window for window snapping. |
| 154 void UpdateSnapPhantomWindow(const gfx::Point& location, | 153 void UpdateSnapPhantomWindow(const gfx::Point& location, |
| 155 const gfx::Rect& bounds); | 154 const gfx::Rect& bounds); |
| 156 | 155 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 // should attach. | 208 // should attach. |
| 210 MatchedEdge magnetism_edge_; | 209 MatchedEdge magnetism_edge_; |
| 211 | 210 |
| 212 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); | 211 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); |
| 213 }; | 212 }; |
| 214 | 213 |
| 215 } // namespace internal | 214 } // namespace internal |
| 216 } // namespace ash | 215 } // namespace ash |
| 217 | 216 |
| 218 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ | 217 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ |
| OLD | NEW |