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

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

Issue 55363004: Enables docked windows by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enables docked windows by default (rebase) Created 7 years, 1 month 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
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 // Returns true if the window should stick to the edge.
138 bool ShouldStickToEdge(int distance_from_edge, int sticky_size) const;
139
137 // Stick the window bounds to the work area during a move. 140 // Stick the window bounds to the work area during a move.
138 bool StickToWorkAreaOnMove(const gfx::Rect& work_area, 141 bool StickToWorkAreaOnMove(const gfx::Rect& work_area,
139 int sticky_size, 142 int sticky_size,
140 gfx::Rect* bounds) const; 143 gfx::Rect* bounds) const;
141 144
142 // Stick the window bounds to the work area during a resize. 145 // Stick the window bounds to the work area during a resize.
143 void StickToWorkAreaOnResize(const gfx::Rect& work_area, 146 void StickToWorkAreaOnResize(const gfx::Rect& work_area,
144 int sticky_size, 147 int sticky_size,
145 gfx::Rect* bounds) const; 148 gfx::Rect* bounds) const;
146 149
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // should attach. 217 // should attach.
215 MatchedEdge magnetism_edge_; 218 MatchedEdge magnetism_edge_;
216 219
217 // Dock container window layout manager. 220 // Dock container window layout manager.
218 DockedWindowLayoutManager* dock_layout_; 221 DockedWindowLayoutManager* dock_layout_;
219 222
220 // Used to determine if this has been deleted during a drag such as when a tab 223 // Used to determine if this has been deleted during a drag such as when a tab
221 // gets dragged into another browser window. 224 // gets dragged into another browser window.
222 base::WeakPtrFactory<WorkspaceWindowResizer> weak_ptr_factory_; 225 base::WeakPtrFactory<WorkspaceWindowResizer> weak_ptr_factory_;
223 226
227 // Current instance for use by the WorkspaceWindowResizerTest.
228 static WorkspaceWindowResizer* instance_;
229
224 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); 230 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer);
225 }; 231 };
226 232
227 } // namespace internal 233 } // namespace internal
228 } // namespace ash 234 } // namespace ash
229 235
230 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ 236 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698