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

Side by Side Diff: ash/wm/window_resizer.h

Issue 10910164: Removes the grid from ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ShelfBrowserTest Created 8 years, 3 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/wm/window_manager_unittest.cc ('k') | ash/wm/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_WINDOW_RESIZER_H_ 5 #ifndef ASH_WM_WINDOW_RESIZER_H_
6 #define ASH_WM_WINDOW_RESIZER_H_ 6 #define ASH_WM_WINDOW_RESIZER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 18 matching lines...) Expand all
29 static const int kBoundsChangeDirection_None; 29 static const int kBoundsChangeDirection_None;
30 static const int kBoundsChangeDirection_Horizontal; 30 static const int kBoundsChangeDirection_Horizontal;
31 static const int kBoundsChangeDirection_Vertical; 31 static const int kBoundsChangeDirection_Vertical;
32 32
33 WindowResizer(); 33 WindowResizer();
34 virtual ~WindowResizer(); 34 virtual ~WindowResizer();
35 35
36 // Returns a bitmask of the kBoundsChange_ values. 36 // Returns a bitmask of the kBoundsChange_ values.
37 static int GetBoundsChangeForWindowComponent(int component); 37 static int GetBoundsChangeForWindowComponent(int component);
38 38
39 // Returns a location >= |location| that is aligned to fall on increments of
40 // |grid_size|.
41 static int AlignToGrid(int location, int grid_size);
42
43 // Variant of AlignToGrid that rounds up.
44 static int AlignToGridRoundUp(int location, int grid_size);
45
46 // Variant of AlignToGrid that rounds down.
47 static int AlignToGridRoundDown(int location, int grid_size);
48
49 // Invoked to drag/move/resize the window. |location| is in the coordinates 39 // Invoked to drag/move/resize the window. |location| is in the coordinates
50 // of the window supplied to the constructor. |event_flags| is the event 40 // of the window supplied to the constructor. |event_flags| is the event
51 // flags from the event. 41 // flags from the event.
52 virtual void Drag(const gfx::Point& location, int event_flags) = 0; 42 virtual void Drag(const gfx::Point& location, int event_flags) = 0;
53 43
54 // Invoked to complete the drag. 44 // Invoked to complete the drag.
55 virtual void CompleteDrag(int event_flags) = 0; 45 virtual void CompleteDrag(int event_flags) = 0;
56 46
57 // Reverts the drag. 47 // Reverts the drag.
58 virtual void RevertDrag() = 0; 48 virtual void RevertDrag() = 0;
(...skipping 30 matching lines...) Expand all
89 // Bitmask of the |kBoundsChangeDirection_| constants. 79 // Bitmask of the |kBoundsChangeDirection_| constants.
90 int position_change_direction; 80 int position_change_direction;
91 81
92 // Bitmask of the |kBoundsChangeDirection_| constants. 82 // Bitmask of the |kBoundsChangeDirection_| constants.
93 int size_change_direction; 83 int size_change_direction;
94 84
95 // Will the drag actually modify the window? 85 // Will the drag actually modify the window?
96 bool is_resizable; 86 bool is_resizable;
97 }; 87 };
98 88
99 static gfx::Rect CalculateBoundsForDrag( 89 static gfx::Rect CalculateBoundsForDrag(const Details& details,
100 const Details& details, 90 const gfx::Point& location);
101 const gfx::Point& location,
102 int grid_size);
103 91
104 static gfx::Rect AdjustBoundsToGrid(const gfx::Rect& bounds, 92 static gfx::Rect AdjustBoundsToGrid(const gfx::Rect& bounds,
105 int grid_size); 93 int grid_size);
106 94
107 static bool IsBottomEdge(int component); 95 static bool IsBottomEdge(int component);
108 96
109 private: 97 private:
110 // Returns the new origin of the window. The arguments are the difference 98 // Returns the new origin of the window. The arguments are the difference
111 // between the current location and the initial location. 99 // between the current location and the initial location.
112 static gfx::Point GetOriginForDrag(const Details& details, 100 static gfx::Point GetOriginForDrag(const Details& details,
113 int delta_x, 101 int delta_x,
114 int delta_y); 102 int delta_y);
115 103
116 // Returns the size of the window for the drag. 104 // Returns the size of the window for the drag.
117 static gfx::Size GetSizeForDrag(const Details& details, 105 static gfx::Size GetSizeForDrag(const Details& details,
118 int* delta_x, 106 int* delta_x,
119 int* delta_y, 107 int* delta_y);
120 int grid_size);
121 108
122 // Returns the width of the window. 109 // Returns the width of the window.
123 static int GetWidthForDrag(const Details& details, 110 static int GetWidthForDrag(const Details& details,
124 int min_width, 111 int min_width,
125 int* delta_x, 112 int* delta_x);
126 int grid_size);
127 113
128 // Returns the height of the drag. 114 // Returns the height of the drag.
129 static int GetHeightForDrag(const Details& details, 115 static int GetHeightForDrag(const Details& details,
130 int min_height, 116 int min_height,
131 int* delta_y, 117 int* delta_y);
132 int grid_size);
133 }; 118 };
134 119
135 } // namespace aura 120 } // namespace aura
136 121
137 #endif // ASH_WM_WINDOW_RESIZER_H_ 122 #endif // ASH_WM_WINDOW_RESIZER_H_
OLDNEW
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | ash/wm/window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698