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

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

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correcting logic to avoid getting stuck on resize Created 7 years, 7 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
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual void Drag(const gfx::Point& location_in_parent, 53 virtual void Drag(const gfx::Point& location_in_parent,
54 int event_flags) OVERRIDE; 54 int event_flags) OVERRIDE;
55 virtual void CompleteDrag(int event_flags) OVERRIDE; 55 virtual void CompleteDrag(int event_flags) OVERRIDE;
56 virtual void RevertDrag() OVERRIDE; 56 virtual void RevertDrag() OVERRIDE;
57 virtual aura::Window* GetTarget() OVERRIDE; 57 virtual aura::Window* GetTarget() OVERRIDE;
58 58
59 const gfx::Point& GetInitialLocationInParentForTest() const { 59 const gfx::Point& GetInitialLocationInParentForTest() const {
60 return details_.initial_location_in_parent; 60 return details_.initial_location_in_parent;
61 } 61 }
62 62
63 // Returns a bitmask of all edges touching the work area bounds
64 static int CalculateStuckEdges(const gfx::Rect& bounds,
65 const gfx::Rect& work_area);
66
63 private: 67 private:
64 WorkspaceWindowResizer(const Details& details, 68 WorkspaceWindowResizer(const Details& details,
65 const std::vector<aura::Window*>& attached_windows); 69 const std::vector<aura::Window*>& attached_windows);
66 70
67 private: 71 private:
68 FRIEND_TEST_ALL_PREFIXES(WorkspaceWindowResizerTest, CancelSnapPhantom); 72 FRIEND_TEST_ALL_PREFIXES(WorkspaceWindowResizerTest, CancelSnapPhantom);
69 FRIEND_TEST_ALL_PREFIXES(WorkspaceWindowResizerTest, PhantomSnapMaxSize); 73 FRIEND_TEST_ALL_PREFIXES(WorkspaceWindowResizerTest, PhantomSnapMaxSize);
70 74
71 // Type of snapping. 75 // Type of snapping.
72 enum SnapType { 76 enum SnapType {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // should attach. 212 // should attach.
209 MatchedEdge magnetism_edge_; 213 MatchedEdge magnetism_edge_;
210 214
211 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); 215 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer);
212 }; 216 };
213 217
214 } // namespace internal 218 } // namespace internal
215 } // namespace ash 219 } // namespace ash
216 220
217 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ 221 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698