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

Side by Side Diff: ash/wm/toplevel_window_event_handler.cc

Issue 23471004: Only support left/right maximizing at 50% width when the --ash-enable-alternate-caption-button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch is now friendlier to pending docking changes Created 7 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
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/toplevel_window_event_handler.h" 5 #include "ash/wm/toplevel_window_event_handler.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/property_util.h" 8 #include "ash/wm/property_util.h"
9 #include "ash/wm/resize_shadow_controller.h" 9 #include "ash/wm/resize_shadow_controller.h"
10 #include "ash/wm/window_properties.h" 10 #include "ash/wm/window_properties.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // Minimize/maximize. 294 // Minimize/maximize.
295 if (event->details().velocity_y() > 0 && 295 if (event->details().velocity_y() > 0 &&
296 wm::CanMinimizeWindow(target)) { 296 wm::CanMinimizeWindow(target)) {
297 wm::MinimizeWindow(target); 297 wm::MinimizeWindow(target);
298 SetWindowAlwaysRestoresToRestoreBounds(target, true); 298 SetWindowAlwaysRestoresToRestoreBounds(target, true);
299 SetRestoreBoundsInParent(target, pre_drag_window_bounds_); 299 SetRestoreBoundsInParent(target, pre_drag_window_bounds_);
300 } else if (wm::CanMaximizeWindow(target)) { 300 } else if (wm::CanMaximizeWindow(target)) {
301 SetRestoreBoundsInParent(target, pre_drag_window_bounds_); 301 SetRestoreBoundsInParent(target, pre_drag_window_bounds_);
302 wm::MaximizeWindow(target); 302 wm::MaximizeWindow(target);
303 } 303 }
304 } else if (wm::CanSnapWindow(target) && 304 } else {
varkha 2013/08/30 17:13:25 Did you leave out the x-velocity check intentional
pkotwicz 2013/08/30 21:10:57 Good catch!
305 fabs(event->details().velocity_x()) > 305 using internal::SnapSizer;
306 kMinHorizVelocityForWindowSwipe) { 306 SnapSizer::Edge edge = event->details().swipe_left() ?
307 // Snap left/right. 307 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE;
308 ui::ScopedLayerAnimationSettings scoped_setter( 308 if (SnapSizer::CanSnapWindow(target, edge)) {
309 target->layer()->GetAnimator()); 309 ui::ScopedLayerAnimationSettings scoped_setter(
310 scoped_setter.SetPreemptionStrategy( 310 target->layer()->GetAnimator());
311 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); 311 scoped_setter.SetPreemptionStrategy(
312 internal::SnapSizer::SnapWindow(target, 312 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
313 event->details().velocity_x() < 0 ? 313 SnapSizer::SnapWindow(target, edge, SnapSizer::STEP_NO);
314 internal::SnapSizer::LEFT_EDGE : internal::SnapSizer::RIGHT_EDGE); 314 }
315 } 315 }
316 break; 316 break;
317 } 317 }
318 default: 318 default:
319 return; 319 return;
320 } 320 }
321 321
322 event->StopPropagation(); 322 event->StopPropagation();
323 } 323 }
324 324
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { 525 void ToplevelWindowEventHandler::ResizerWindowDestroyed() {
526 // We explicitly don't invoke RevertDrag() since that may do things to window. 526 // We explicitly don't invoke RevertDrag() since that may do things to window.
527 // Instead we destroy the resizer. 527 // Instead we destroy the resizer.
528 window_resizer_.reset(); 528 window_resizer_.reset();
529 529
530 // End the move loop. This does nothing if we're not in a move loop. 530 // End the move loop. This does nothing if we're not in a move loop.
531 EndMoveLoop(); 531 EndMoveLoop();
532 } 532 }
533 533
534 } // namespace ash 534 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698