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

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

Issue 10823199: While dragging a window, show a semi-transparent aura window instead of the standard gray phantom wi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fill bug # Created 8 years, 4 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
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"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 14
14 namespace aura { 15 namespace aura {
15 class RootWindow; 16 class RootWindow;
16 } // namespace aura 17 } // namespace aura
17 18
18 namespace ash { 19 namespace ash {
19 namespace internal { 20 namespace internal {
20 21
21 class PhantomWindowController; 22 class PhantomWindowController;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Overridden from WindowResizer: 56 // Overridden from WindowResizer:
56 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE; 57 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE;
57 virtual void CompleteDrag(int event_flags) OVERRIDE; 58 virtual void CompleteDrag(int event_flags) OVERRIDE;
58 virtual void RevertDrag() OVERRIDE; 59 virtual void RevertDrag() OVERRIDE;
59 60
60 private: 61 private:
61 WorkspaceWindowResizer(const Details& details, 62 WorkspaceWindowResizer(const Details& details,
62 const std::vector<aura::Window*>& attached_windows); 63 const std::vector<aura::Window*>& attached_windows);
63 64
64 private: 65 private:
66 FRIEND_TEST_ALL_PREFIXES(WorkspaceWindowResizerTest, PhantomStyle);
67
65 // Type of snapping. 68 // Type of snapping.
66 enum SnapType { 69 enum SnapType {
67 // Snap to the left/right edge of the screen. 70 // Snap to the left/right edge of the screen.
68 SNAP_LEFT_EDGE, 71 SNAP_LEFT_EDGE,
69 SNAP_RIGHT_EDGE, 72 SNAP_RIGHT_EDGE,
70 73
71 // No snap position. 74 // No snap position.
72 SNAP_NONE 75 SNAP_NONE
73 }; 76 };
74 77
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Returns a coordinate along the primary axis. Used to share code for 110 // Returns a coordinate along the primary axis. Used to share code for
108 // left/right multi window resize and top/bottom resize. 111 // left/right multi window resize and top/bottom resize.
109 int PrimaryAxisSize(const gfx::Size& size) const; 112 int PrimaryAxisSize(const gfx::Size& size) const;
110 int PrimaryAxisCoordinate(int x, int y) const; 113 int PrimaryAxisCoordinate(int x, int y) const;
111 114
112 // Updates the bounds of the phantom window for window snapping. 115 // Updates the bounds of the phantom window for window snapping.
113 void UpdateSnapPhantomWindow(const gfx::Point& location, 116 void UpdateSnapPhantomWindow(const gfx::Point& location,
114 const gfx::Rect& bounds, 117 const gfx::Rect& bounds,
115 int grid_size); 118 int grid_size);
116 119
117 // Updates the bounds of the phantom window for window dragging. 120 // Updates the bounds of the phantom window for window dragging. Set true on
118 void UpdateDragPhantomWindow(const gfx::Rect& bounds); 121 // |in_original_root| if the pointer is still in |window()->GetRootWindow()|.
122 void UpdateDragPhantomWindow(const gfx::Rect& bounds, bool in_original_root);
119 123
120 // Restacks the windows z-order position so that one of the windows is at the 124 // Restacks the windows z-order position so that one of the windows is at the
121 // top of the z-order, and the rest directly underneath it. 125 // top of the z-order, and the rest directly underneath it.
122 void RestackWindows(); 126 void RestackWindows();
123 127
124 // Returns the SnapType for the specified point. SNAP_NONE is used if no 128 // Returns the SnapType for the specified point. SNAP_NONE is used if no
125 // snapping should be used. 129 // snapping should be used.
126 SnapType GetSnapType(const gfx::Point& location) const; 130 SnapType GetSnapType(const gfx::Point& location) const;
127 131
128 // Returns true if we should allow the mouse pointer to warp. 132 // Returns true if we should allow the mouse pointer to warp.
(...skipping 29 matching lines...) Expand all
158 // Sum of sizes in |min_size_|. 162 // Sum of sizes in |min_size_|.
159 int total_min_; 163 int total_min_;
160 164
161 // Sum of the sizes in |initial_size_|. 165 // Sum of the sizes in |initial_size_|.
162 int total_initial_size_; 166 int total_initial_size_;
163 167
164 // Gives a previews of where the the window will end up. Only used if there 168 // Gives a previews of where the the window will end up. Only used if there
165 // is a grid and the caption is being dragged. 169 // is a grid and the caption is being dragged.
166 scoped_ptr<PhantomWindowController> snap_phantom_window_controller_; 170 scoped_ptr<PhantomWindowController> snap_phantom_window_controller_;
167 171
168 // For now, we show a phantom window on the other root window during dragging. 172 // Shows a semi-transparent image of the window being dragged.
169 // TODO(yusukes): Show a semi-transparent image (screen shot) of the window
170 // instead.
171 scoped_ptr<PhantomWindowController> drag_phantom_window_controller_; 173 scoped_ptr<PhantomWindowController> drag_phantom_window_controller_;
172 174
173 // Used to determine the target position of a snap. 175 // Used to determine the target position of a snap.
174 scoped_ptr<SnapSizer> snap_sizer_; 176 scoped_ptr<SnapSizer> snap_sizer_;
175 177
176 // Last SnapType. 178 // Last SnapType.
177 SnapType snap_type_; 179 SnapType snap_type_;
178 180
179 // Number of mouse moves since the last bounds change. Only used for phantom 181 // Number of mouse moves since the last bounds change. Only used for phantom
180 // placement to track when the mouse is moved while pushed against the edge of 182 // placement to track when the mouse is moved while pushed against the edge of
181 // the screen. 183 // the screen.
182 int num_mouse_moves_since_bounds_change_; 184 int num_mouse_moves_since_bounds_change_;
183 185
184 // The mouse location passed to Drag(). 186 // The mouse location passed to Drag().
185 gfx::Point last_mouse_location_; 187 gfx::Point last_mouse_location_;
186 188
187 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); 189 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer);
188 }; 190 };
189 191
190 } // namespace internal 192 } // namespace internal
191 } // namespace ash 193 } // namespace ash
192 194
193 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_ 195 #endif // ASH_WM_WORKSPACE_WINDOW_RESIZER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/phantom_window_controller.cc ('k') | ash/wm/workspace/workspace_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698