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

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

Issue 10008084: Add ctrl+drag feature for allowing resizing window with exact positioning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add event_flag to MultiWindowResizeController Resize and CompleteResize. Created 8 years, 8 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 #include "ash/wm/workspace/workspace_window_resizer.h" 5 #include "ash/wm/workspace/workspace_window_resizer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 WorkspaceWindowResizer::~WorkspaceWindowResizer() { 46 WorkspaceWindowResizer::~WorkspaceWindowResizer() {
47 if (root_filter_) 47 if (root_filter_)
48 root_filter_->UnlockCursor(); 48 root_filter_->UnlockCursor();
49 } 49 }
50 50
51 // static 51 // static
52 WorkspaceWindowResizer* WorkspaceWindowResizer::Create( 52 WorkspaceWindowResizer* WorkspaceWindowResizer::Create(
53 aura::Window* window, 53 aura::Window* window,
54 const gfx::Point& location, 54 const gfx::Point& location,
55 int window_component, 55 int window_component,
56 int grid_size,
57 const std::vector<aura::Window*>& attached_windows) { 56 const std::vector<aura::Window*>& attached_windows) {
58 Details details(window, location, window_component, grid_size); 57 Details details(window, location, window_component);
59 return details.is_resizable ? 58 return details.is_resizable ?
60 new WorkspaceWindowResizer(details, attached_windows) : NULL; 59 new WorkspaceWindowResizer(details, attached_windows) : NULL;
61 } 60 }
62 61
63 void WorkspaceWindowResizer::Drag(const gfx::Point& location) { 62 void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) {
64 gfx::Rect bounds = CalculateBoundsForDrag(details_, location); 63 int grid_size = event_flags & ui::EF_CONTROL_DOWN ?
64 0 : ash::Shell::GetInstance()->GetGridSize();
65 gfx::Rect bounds = CalculateBoundsForDrag(details_, location, grid_size);
66
65 if (wm::IsWindowNormal(details_.window)) 67 if (wm::IsWindowNormal(details_.window))
66 AdjustBoundsForMainWindow(&bounds); 68 AdjustBoundsForMainWindow(&bounds, grid_size);
67 if (bounds != details_.window->bounds()) { 69 if (bounds != details_.window->bounds()) {
68 if (!did_move_or_resize_) 70 if (!did_move_or_resize_)
69 RestackWindows(); 71 RestackWindows();
70 did_move_or_resize_ = true; 72 did_move_or_resize_ = true;
71 } 73 }
72 UpdatePhantomWindow(location, bounds); 74 UpdatePhantomWindow(location, bounds, grid_size);
73 if (!attached_windows_.empty()) 75 if (!attached_windows_.empty())
74 LayoutAttachedWindows(bounds); 76 LayoutAttachedWindows(bounds, grid_size);
75 if (bounds != details_.window->bounds()) 77 if (bounds != details_.window->bounds())
76 details_.window->SetBounds(bounds); 78 details_.window->SetBounds(bounds);
77 // WARNING: we may have been deleted. 79 // WARNING: we may have been deleted.
78 } 80 }
79 81
80 void WorkspaceWindowResizer::CompleteDrag() { 82 void WorkspaceWindowResizer::CompleteDrag(int event_flags) {
81 phantom_window_controller_.reset(); 83 phantom_window_controller_.reset();
82 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) 84 if (!did_move_or_resize_ || details_.window_component != HTCAPTION)
83 return; 85 return;
84 86
85 if (snap_type_ == SNAP_LEFT_EDGE || snap_type_ == SNAP_RIGHT_EDGE) { 87 if (snap_type_ == SNAP_LEFT_EDGE || snap_type_ == SNAP_RIGHT_EDGE) {
86 if (!GetRestoreBounds(details_.window)) 88 if (!GetRestoreBounds(details_.window))
87 SetRestoreBounds(details_.window, details_.initial_bounds); 89 SetRestoreBounds(details_.window, details_.initial_bounds);
88 details_.window->SetBounds(snap_sizer_->target_bounds()); 90 details_.window->SetBounds(snap_sizer_->target_bounds());
89 return; 91 return;
90 } 92 }
91 93
92 if (details_.grid_size <= 1) 94 int grid_size = event_flags & ui::EF_CONTROL_DOWN ?
95 0 : ash::Shell::GetInstance()->GetGridSize();
96 if (grid_size <= 1)
93 return; 97 return;
94 98
95 gfx::Rect bounds(GetFinalBounds(details_.window->bounds())); 99 gfx::Rect bounds(GetFinalBounds(details_.window->bounds(), grid_size));
96 if (bounds == details_.window->bounds()) 100 if (bounds == details_.window->bounds())
97 return; 101 return;
98 102
99 if (bounds.size() != details_.window->bounds().size()) { 103 if (bounds.size() != details_.window->bounds().size()) {
100 // Don't attempt to animate a size change. 104 // Don't attempt to animate a size change.
101 details_.window->SetBounds(bounds); 105 details_.window->SetBounds(bounds);
102 return; 106 return;
103 } 107 }
104 108
105 ui::ScopedLayerAnimationSettings scoped_setter( 109 ui::ScopedLayerAnimationSettings scoped_setter(
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 160
157 // Only support attaching to the right/bottom. 161 // Only support attaching to the right/bottom.
158 DCHECK(attached_windows_.empty() || 162 DCHECK(attached_windows_.empty() ||
159 (details.window_component == HTRIGHT || 163 (details.window_component == HTRIGHT ||
160 details.window_component == HTBOTTOM)); 164 details.window_component == HTBOTTOM));
161 165
162 // TODO: figure out how to deal with window going off the edge. 166 // TODO: figure out how to deal with window going off the edge.
163 167
164 // Calculate sizes so that we can maintain the ratios if we need to resize. 168 // Calculate sizes so that we can maintain the ratios if we need to resize.
165 int total_available = 0; 169 int total_available = 0;
170 int grid_size = ash::Shell::GetInstance()->GetGridSize();
166 for (size_t i = 0; i < attached_windows_.size(); ++i) { 171 for (size_t i = 0; i < attached_windows_.size(); ++i) {
167 gfx::Size min(attached_windows_[i]->delegate()->GetMinimumSize()); 172 gfx::Size min(attached_windows_[i]->delegate()->GetMinimumSize());
168 int initial_size = PrimaryAxisSize(attached_windows_[i]->bounds().size()); 173 int initial_size = PrimaryAxisSize(attached_windows_[i]->bounds().size());
169 initial_size_.push_back(initial_size); 174 initial_size_.push_back(initial_size);
170 // If current size is smaller than the min, use the current size as the min. 175 // If current size is smaller than the min, use the current size as the min.
171 // This way we don't snap on resize. 176 // This way we don't snap on resize.
172 int min_size = std::min(initial_size, 177 int min_size = std::min(initial_size,
173 std::max(PrimaryAxisSize(min), kMinOnscreenSize)); 178 std::max(PrimaryAxisSize(min), kMinOnscreenSize));
174 // Make sure the min size falls on the grid. 179 // Make sure the min size falls on the grid.
175 if (details_.grid_size > 1 && min_size % details_.grid_size != 0) 180 if (grid_size > 1 && min_size % grid_size != 0)
176 min_size = (min_size / details_.grid_size + 1) * details_.grid_size; 181 min_size = (min_size / grid_size + 1) * grid_size;
177 min_size_.push_back(min_size); 182 min_size_.push_back(min_size);
178 total_min_ += min_size; 183 total_min_ += min_size;
179 total_initial_size_ += initial_size; 184 total_initial_size_ += initial_size;
180 total_available += std::max(min_size, initial_size) - min_size; 185 total_available += std::max(min_size, initial_size) - min_size;
181 } 186 }
182 187
183 for (size_t i = 0; i < attached_windows_.size(); ++i) { 188 for (size_t i = 0; i < attached_windows_.size(); ++i) {
184 expand_fraction_.push_back( 189 expand_fraction_.push_back(
185 static_cast<float>(initial_size_[i]) / 190 static_cast<float>(initial_size_[i]) /
186 static_cast<float>(total_initial_size_)); 191 static_cast<float>(total_initial_size_));
187 if (total_initial_size_ != total_min_) { 192 if (total_initial_size_ != total_min_) {
188 compress_fraction_.push_back( 193 compress_fraction_.push_back(
189 static_cast<float>(initial_size_[i] - min_size_[i]) / 194 static_cast<float>(initial_size_[i] - min_size_[i]) /
190 static_cast<float>(total_available)); 195 static_cast<float>(total_available));
191 } else { 196 } else {
192 compress_fraction_.push_back(0.0f); 197 compress_fraction_.push_back(0.0f);
193 } 198 }
194 } 199 }
195 } 200 }
196 201
197 gfx::Rect WorkspaceWindowResizer::GetFinalBounds( 202 gfx::Rect WorkspaceWindowResizer::GetFinalBounds(
198 const gfx::Rect& bounds) const { 203 const gfx::Rect& bounds, int grid_size) const {
sky 2012/04/16 21:16:30 grid_size on its own line (212 too).
jennyz 2012/04/16 23:09:40 Done.
199 if (phantom_window_controller_.get() && 204 if (phantom_window_controller_.get() &&
200 phantom_window_controller_->IsShowing()) { 205 phantom_window_controller_->IsShowing()) {
201 return phantom_window_controller_->bounds(); 206 return phantom_window_controller_->bounds();
202 } 207 }
203 return AdjustBoundsToGrid(bounds, details_.grid_size); 208 return AdjustBoundsToGrid(bounds, grid_size);
204 } 209 }
205 210
206 void WorkspaceWindowResizer::LayoutAttachedWindows( 211 void WorkspaceWindowResizer::LayoutAttachedWindows(
207 const gfx::Rect& bounds) { 212 const gfx::Rect& bounds, int grid_size) {
208 gfx::Rect work_area(gfx::Screen::GetMonitorWorkAreaNearestWindow(window())); 213 gfx::Rect work_area(gfx::Screen::GetMonitorWorkAreaNearestWindow(window()));
209 std::vector<int> sizes; 214 std::vector<int> sizes;
210 CalculateAttachedSizes( 215 CalculateAttachedSizes(
211 PrimaryAxisSize(details_.initial_bounds.size()), 216 PrimaryAxisSize(details_.initial_bounds.size()),
212 PrimaryAxisSize(bounds.size()), 217 PrimaryAxisSize(bounds.size()),
213 PrimaryAxisCoordinate(bounds.right(), bounds.bottom()), 218 PrimaryAxisCoordinate(bounds.right(), bounds.bottom()),
214 PrimaryAxisCoordinate(work_area.right(), work_area.bottom()), 219 PrimaryAxisCoordinate(work_area.right(), work_area.bottom()),
220 grid_size,
215 &sizes); 221 &sizes);
216 DCHECK_EQ(attached_windows_.size(), sizes.size()); 222 DCHECK_EQ(attached_windows_.size(), sizes.size());
217 int last = PrimaryAxisCoordinate(bounds.right(), bounds.bottom()); 223 int last = PrimaryAxisCoordinate(bounds.right(), bounds.bottom());
218 for (size_t i = 0; i < attached_windows_.size(); ++i) { 224 for (size_t i = 0; i < attached_windows_.size(); ++i) {
219 gfx::Rect attached_bounds(attached_windows_[i]->bounds()); 225 gfx::Rect attached_bounds(attached_windows_[i]->bounds());
220 if (details_.window_component == HTRIGHT) { 226 if (details_.window_component == HTRIGHT) {
221 attached_bounds.set_x(last); 227 attached_bounds.set_x(last);
222 attached_bounds.set_width(sizes[i]); 228 attached_bounds.set_width(sizes[i]);
223 } else { 229 } else {
224 attached_bounds.set_y(last); 230 attached_bounds.set_y(last);
225 attached_bounds.set_height(sizes[i]); 231 attached_bounds.set_height(sizes[i]);
226 } 232 }
227 attached_windows_[i]->SetBounds(attached_bounds); 233 attached_windows_[i]->SetBounds(attached_bounds);
228 last += sizes[i]; 234 last += sizes[i];
229 } 235 }
230 } 236 }
231 237
232 void WorkspaceWindowResizer::CalculateAttachedSizes( 238 void WorkspaceWindowResizer::CalculateAttachedSizes(
233 int initial_size, 239 int initial_size,
234 int current_size, 240 int current_size,
235 int start, 241 int start,
236 int end, 242 int end,
243 int grid_size,
237 std::vector<int>* sizes) const { 244 std::vector<int>* sizes) const {
238 sizes->clear(); 245 sizes->clear();
239 if (current_size < initial_size) { 246 if (current_size < initial_size) {
240 // If the primary window is sized smaller, resize the attached windows. 247 // If the primary window is sized smaller, resize the attached windows.
241 int current = start; 248 int current = start;
242 int delta = initial_size - current_size; 249 int delta = initial_size - current_size;
243 for (size_t i = 0; i < attached_windows_.size(); ++i) { 250 for (size_t i = 0; i < attached_windows_.size(); ++i) {
244 int next = AlignToGrid( 251 int next = AlignToGrid(
245 current + initial_size_[i] + expand_fraction_[i] * delta, 252 current + initial_size_[i] + expand_fraction_[i] * delta,
246 details_.grid_size); 253 grid_size);
247 if (i == attached_windows_.size()) 254 if (i == attached_windows_.size())
248 next = end; 255 next = end;
249 sizes->push_back(next - current); 256 sizes->push_back(next - current);
250 current = next; 257 current = next;
251 } 258 }
252 } else if (start <= end - total_initial_size_) { 259 } else if (start <= end - total_initial_size_) {
253 // All the windows fit at their initial size; tile them horizontally. 260 // All the windows fit at their initial size; tile them horizontally.
254 for (size_t i = 0; i < attached_windows_.size(); ++i) 261 for (size_t i = 0; i < attached_windows_.size(); ++i)
255 sizes->push_back(initial_size_[i]); 262 sizes->push_back(initial_size_[i]);
256 } else { 263 } else {
257 DCHECK_NE(total_initial_size_, total_min_); 264 DCHECK_NE(total_initial_size_, total_min_);
258 int delta = total_initial_size_ - (end - start); 265 int delta = total_initial_size_ - (end - start);
259 int current = start; 266 int current = start;
260 for (size_t i = 0; i < attached_windows_.size(); ++i) { 267 for (size_t i = 0; i < attached_windows_.size(); ++i) {
261 int size = initial_size_[i] - 268 int size = initial_size_[i] -
262 static_cast<int>(compress_fraction_[i] * delta); 269 static_cast<int>(compress_fraction_[i] * delta);
263 size = AlignToGrid(size, details_.grid_size); 270 size = AlignToGrid(size, grid_size);
264 if (i == attached_windows_.size()) 271 if (i == attached_windows_.size())
265 size = end - current; 272 size = end - current;
266 current += size; 273 current += size;
267 sizes->push_back(size); 274 sizes->push_back(size);
268 } 275 }
269 } 276 }
270 } 277 }
271 278
272 void WorkspaceWindowResizer::AdjustBoundsForMainWindow( 279 void WorkspaceWindowResizer::AdjustBoundsForMainWindow(
273 gfx::Rect* bounds) const { 280 gfx::Rect* bounds, int grid_size) const {
274 // Always keep kMinOnscreenHeight on the bottom. 281 // Always keep kMinOnscreenHeight on the bottom.
275 gfx::Rect work_area(gfx::Screen::GetMonitorWorkAreaNearestWindow(window())); 282 gfx::Rect work_area(gfx::Screen::GetMonitorWorkAreaNearestWindow(window()));
276 int max_y = AlignToGridRoundUp(work_area.bottom() - kMinOnscreenHeight, 283 int max_y = AlignToGridRoundUp(work_area.bottom() - kMinOnscreenHeight,
277 details_.grid_size); 284 grid_size);
278 if (bounds->y() > max_y) 285 if (bounds->y() > max_y)
279 bounds->set_y(max_y); 286 bounds->set_y(max_y);
280 287
281 // Don't allow dragging above the top of the monitor. 288 // Don't allow dragging above the top of the monitor.
282 if (bounds->y() <= work_area.y()) 289 if (bounds->y() <= work_area.y())
283 bounds->set_y(work_area.y()); 290 bounds->set_y(work_area.y());
284 291
285 if (details_.grid_size >= 0 && details_.window_component == HTCAPTION) 292 if (grid_size >= 0 && details_.window_component == HTCAPTION)
286 SnapToWorkAreaEdges(work_area, bounds); 293 SnapToWorkAreaEdges(work_area, bounds, grid_size);
287 294
288 if (attached_windows_.empty()) 295 if (attached_windows_.empty())
289 return; 296 return;
290 297
291 if (details_.window_component == HTRIGHT) { 298 if (details_.window_component == HTRIGHT) {
292 bounds->set_width(std::min(bounds->width(), 299 bounds->set_width(std::min(bounds->width(),
293 work_area.right() - total_min_ - bounds->x())); 300 work_area.right() - total_min_ - bounds->x()));
294 } else { 301 } else {
295 DCHECK_EQ(HTBOTTOM, details_.window_component); 302 DCHECK_EQ(HTBOTTOM, details_.window_component);
296 bounds->set_height(std::min(bounds->height(), 303 bounds->set_height(std::min(bounds->height(),
297 work_area.bottom() - total_min_ - bounds->y())); 304 work_area.bottom() - total_min_ - bounds->y()));
298 } 305 }
299 } 306 }
300 307
301 void WorkspaceWindowResizer::SnapToWorkAreaEdges( 308 void WorkspaceWindowResizer::SnapToWorkAreaEdges(
302 const gfx::Rect& work_area, 309 const gfx::Rect& work_area,
303 gfx::Rect* bounds) const { 310 gfx::Rect* bounds,
304 int left_edge = AlignToGridRoundUp(work_area.x(), details_.grid_size); 311 int grid_size) const {
305 int right_edge = AlignToGridRoundDown(work_area.right(), details_.grid_size); 312 int left_edge = AlignToGridRoundUp(work_area.x(), grid_size);
306 int top_edge = AlignToGridRoundUp(work_area.y(), details_.grid_size); 313 int right_edge = AlignToGridRoundDown(work_area.right(), grid_size);
314 int top_edge = AlignToGridRoundUp(work_area.y(), grid_size);
307 int bottom_edge = AlignToGridRoundDown(work_area.bottom(), 315 int bottom_edge = AlignToGridRoundDown(work_area.bottom(),
308 details_.grid_size); 316 grid_size);
309 if (ShouldSnapToEdge(bounds->x() - left_edge, details_.grid_size)) { 317 if (ShouldSnapToEdge(bounds->x() - left_edge, grid_size)) {
310 bounds->set_x(left_edge); 318 bounds->set_x(left_edge);
311 } else if (ShouldSnapToEdge(right_edge - bounds->right(), 319 } else if (ShouldSnapToEdge(right_edge - bounds->right(),
312 details_.grid_size)) { 320 grid_size)) {
313 bounds->set_x(right_edge - bounds->width()); 321 bounds->set_x(right_edge - bounds->width());
314 } 322 }
315 if (ShouldSnapToEdge(bounds->y() - top_edge, details_.grid_size)) { 323 if (ShouldSnapToEdge(bounds->y() - top_edge, grid_size)) {
316 bounds->set_y(top_edge); 324 bounds->set_y(top_edge);
317 } else if (ShouldSnapToEdge(bottom_edge - bounds->bottom(), 325 } else if (ShouldSnapToEdge(bottom_edge - bounds->bottom(), grid_size) &&
318 details_.grid_size) &&
319 bounds->height() < (bottom_edge - top_edge)) { 326 bounds->height() < (bottom_edge - top_edge)) {
320 // Only snap to the bottom if the window is smaller than the work area. 327 // Only snap to the bottom if the window is smaller than the work area.
321 // Doing otherwise can lead to window snapping in weird ways as it bounces 328 // Doing otherwise can lead to window snapping in weird ways as it bounces
322 // between snapping to top then bottom. 329 // between snapping to top then bottom.
323 bounds->set_y(bottom_edge - bounds->height()); 330 bounds->set_y(bottom_edge - bounds->height());
324 } 331 }
325 } 332 }
326 333
327 bool WorkspaceWindowResizer::TouchesBottomOfScreen() const { 334 bool WorkspaceWindowResizer::TouchesBottomOfScreen() const {
328 gfx::Rect work_area( 335 gfx::Rect work_area(
(...skipping 14 matching lines...) Expand all
343 return x; 350 return x;
344 case HTBOTTOM: 351 case HTBOTTOM:
345 return y; 352 return y;
346 default: 353 default:
347 NOTREACHED(); 354 NOTREACHED();
348 } 355 }
349 return 0; 356 return 0;
350 } 357 }
351 358
352 void WorkspaceWindowResizer::UpdatePhantomWindow(const gfx::Point& location, 359 void WorkspaceWindowResizer::UpdatePhantomWindow(const gfx::Point& location,
353 const gfx::Rect& bounds) { 360 const gfx::Rect& bounds,
361 int grid_size) {
354 if (!did_move_or_resize_ || details_.window_component != HTCAPTION) 362 if (!did_move_or_resize_ || details_.window_component != HTCAPTION)
355 return; 363 return;
356 364
357 SnapType last_type = snap_type_; 365 SnapType last_type = snap_type_;
358 snap_type_ = GetSnapType(location); 366 snap_type_ = GetSnapType(location);
359 if (snap_type_ == SNAP_NONE || snap_type_ != last_type) { 367 if (snap_type_ == SNAP_NONE || snap_type_ != last_type) {
360 phantom_window_controller_.reset(); 368 phantom_window_controller_.reset();
361 snap_sizer_.reset(); 369 snap_sizer_.reset();
362 if (snap_type_ == SNAP_NONE) 370 if (snap_type_ == SNAP_NONE)
363 return; 371 return;
364 } 372 }
365 if (!snap_sizer_.get()) { 373 if (!snap_sizer_.get()) {
366 SnapSizer::Edge edge = (snap_type_ == SNAP_LEFT_EDGE) ? 374 SnapSizer::Edge edge = (snap_type_ == SNAP_LEFT_EDGE) ?
367 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE; 375 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE;
368 snap_sizer_.reset( 376 snap_sizer_.reset(
369 new SnapSizer(details_.window, location, edge, details_.grid_size)); 377 new SnapSizer(details_.window, location, edge, grid_size));
370 } else { 378 } else {
371 snap_sizer_->Update(location); 379 snap_sizer_->Update(location);
372 } 380 }
373 if (!phantom_window_controller_.get()) { 381 if (!phantom_window_controller_.get()) {
374 phantom_window_controller_.reset( 382 phantom_window_controller_.reset(
375 new PhantomWindowController(details_.window)); 383 new PhantomWindowController(details_.window));
376 } 384 }
377 phantom_window_controller_->Show(snap_sizer_->target_bounds()); 385 phantom_window_controller_->Show(snap_sizer_->target_bounds());
378 } 386 }
379 387
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 gfx::Rect area(gfx::Screen::GetMonitorAreaNearestWindow(details_.window)); 423 gfx::Rect area(gfx::Screen::GetMonitorAreaNearestWindow(details_.window));
416 if (location.x() <= area.x()) 424 if (location.x() <= area.x())
417 return SNAP_LEFT_EDGE; 425 return SNAP_LEFT_EDGE;
418 if (location.x() >= area.right() - 1) 426 if (location.x() >= area.right() - 1)
419 return SNAP_RIGHT_EDGE; 427 return SNAP_RIGHT_EDGE;
420 return SNAP_NONE; 428 return SNAP_NONE;
421 } 429 }
422 430
423 } // namespace internal 431 } // namespace internal
424 } // namespace ash 432 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698