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

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

Issue 11434004: ash: Refactor some code that snaps windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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/wm/window_util.cc ('k') | ash/wm/workspace/snap_sizer.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_SNAP_SIZER_H_ 5 #ifndef ASH_WM_WORKSPACE_SNAP_SIZER_H_
6 #define ASH_WM_WORKSPACE_SNAP_SIZER_H_ 6 #define ASH_WM_WORKSPACE_SNAP_SIZER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 25 matching lines...) Expand all
36 36
37 // Set |input_type| to |TOUCH_MAXIMIZE_BUTTON_INPUT| when called by a touch 37 // Set |input_type| to |TOUCH_MAXIMIZE_BUTTON_INPUT| when called by a touch
38 // operation by the maximize button. This will allow the user to snap resize 38 // operation by the maximize button. This will allow the user to snap resize
39 // the window beginning close to the border. 39 // the window beginning close to the border.
40 SnapSizer(aura::Window* window, 40 SnapSizer(aura::Window* window,
41 const gfx::Point& start, 41 const gfx::Point& start,
42 Edge edge, 42 Edge edge,
43 InputType input_type); 43 InputType input_type);
44 virtual ~SnapSizer(); 44 virtual ~SnapSizer();
45 45
46 // Snaps a window left or right.
47 static void SnapWindow(aura::Window* window, Edge edge);
48
46 // Updates the target bounds based on a mouse move. 49 // Updates the target bounds based on a mouse move.
47 void Update(const gfx::Point& location); 50 void Update(const gfx::Point& location);
48 51
49 // Bounds to position the window at. 52 // Bounds to position the window at.
50 const gfx::Rect& target_bounds() const { return target_bounds_; } 53 const gfx::Rect& target_bounds() const { return target_bounds_; }
51 54
52 // Returns the appropriate snap bounds (e.g. if a window is already snapped, 55 // Returns the appropriate snap bounds (e.g. if a window is already snapped,
53 // then it returns the next snap-bounds). 56 // then it returns the next snap-bounds).
54 gfx::Rect GetSnapBounds(const gfx::Rect& bounds); 57 gfx::Rect GetSnapBounds(const gfx::Rect& bounds);
55 58
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // sizer gets created. 121 // sizer gets created.
119 const std::vector<int> usable_width_; 122 const std::vector<int> usable_width_;
120 123
121 DISALLOW_COPY_AND_ASSIGN(SnapSizer); 124 DISALLOW_COPY_AND_ASSIGN(SnapSizer);
122 }; 125 };
123 126
124 } // namespace internal 127 } // namespace internal
125 } // namespace ash 128 } // namespace ash
126 129
127 #endif // ASH_WM_WORKSPACE_SNAP_SIZER_H_ 130 #endif // ASH_WM_WORKSPACE_SNAP_SIZER_H_
OLDNEW
« no previous file with comments | « ash/wm/window_util.cc ('k') | ash/wm/workspace/snap_sizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698