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

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

Issue 163833003: Stick edge to both window and work area at the same time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « no previous file | ash/wm/workspace/workspace_window_resizer_unittest.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 #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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 bounds->set_y(max_y); 782 bounds->set_y(max_y);
783 } else if (bounds->y() <= work_area.y()) { 783 } else if (bounds->y() <= work_area.y()) {
784 // Don't allow dragging above the top of the display until the mouse 784 // Don't allow dragging above the top of the display until the mouse
785 // cursor reaches the work area above if any. 785 // cursor reaches the work area above if any.
786 bounds->set_y(work_area.y()); 786 bounds->set_y(work_area.y());
787 } 787 }
788 788
789 if (sticky_size > 0) { 789 if (sticky_size > 0) {
790 // Possibly stick to edge except when a mouse pointer is outside the 790 // Possibly stick to edge except when a mouse pointer is outside the
791 // work area. 791 // work area.
792 if (!(display.work_area().Contains(last_mouse_location_in_screen) && 792 if (display.work_area().Contains(last_mouse_location_in_screen))
793 StickToWorkAreaOnMove(work_area, sticky_size, bounds))) { 793 StickToWorkAreaOnMove(work_area, sticky_size, bounds);
794 MagneticallySnapToOtherWindows(bounds); 794 MagneticallySnapToOtherWindows(bounds);
795 }
796 } 795 }
797 } else if (sticky_size > 0) { 796 } else if (sticky_size > 0) {
798 MagneticallySnapResizeToOtherWindows(bounds); 797 MagneticallySnapResizeToOtherWindows(bounds);
799 if (!magnetism_window_ && sticky_size > 0) 798 if (!magnetism_window_ && sticky_size > 0)
800 StickToWorkAreaOnResize(work_area, sticky_size, bounds); 799 StickToWorkAreaOnResize(work_area, sticky_size, bounds);
801 } 800 }
802 801
803 if (attached_windows_.empty()) 802 if (attached_windows_.empty())
804 return; 803 return;
805 804
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 } else { 1021 } else {
1023 if (dock_layout_->is_dragged_window_docked()) { 1022 if (dock_layout_->is_dragged_window_docked()) {
1024 dock_layout_->UndockDraggedWindow(); 1023 dock_layout_->UndockDraggedWindow();
1025 window_state()->set_bounds_changed_by_user(true); 1024 window_state()->set_bounds_changed_by_user(true);
1026 } 1025 }
1027 } 1026 }
1028 } 1027 }
1029 1028
1030 } // namespace internal 1029 } // namespace internal
1031 } // namespace ash 1030 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698