Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: ash/wm/workspace/workspace_window_resizer.h

Issue 14273008: Add ash-enable-sticky-edges for 'sticky' instead of 'snap' behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/ash_switches.cc ('k') | ash/wm/workspace/workspace_window_resizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // Stick the window bounds to the work area during a move.
138 void SnapToWorkAreaEdges( 138 void StickToWorkAreaOnMove(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 // Stick the window bounds to the work area during a resize.
144 void SnapResizeToWorkAreaBounds(const gfx::Rect& work_area, 143 void StickToWorkAreaOnResize(const gfx::Rect& work_area,
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
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_
OLDNEW
« no previous file with comments | « ash/ash_switches.cc ('k') | ash/wm/workspace/workspace_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698