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

Unified Diff: trunk/src/ash/wm/drag_window_resizer.cc

Issue 108343005: Revert 240542 "Make sure the dragged window is smaller than work..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/ash/root_window_controller_unittest.cc ('k') | trunk/src/ash/wm/drag_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ash/wm/drag_window_resizer.cc
===================================================================
--- trunk/src/ash/wm/drag_window_resizer.cc (revision 240586)
+++ trunk/src/ash/wm/drag_window_resizer.cc (working copy)
@@ -125,29 +125,9 @@
if (dst_display.id() !=
screen->GetDisplayNearestWindow(GetTarget()->GetRootWindow()).id()) {
- // Adjust the size and position so that it doesn't exceed the size of
- // work area.
- const gfx::Size& size = dst_display.work_area().size();
- gfx::Rect bounds = GetTarget()->bounds();
- if (bounds.width() > size.width()) {
- int diff = bounds.width() - size.width();
- bounds.set_x(bounds.x() + diff / 2);
- bounds.set_width(size.width());
- }
- if (bounds.height() > size.height())
- bounds.set_height(size.height());
-
- gfx::Rect dst_bounds =
- ScreenAsh::ConvertRectToScreen(GetTarget()->parent(), bounds);
-
- // Adjust the position so that the cursor is on the window.
- if (!dst_bounds.Contains(last_mouse_location_in_screen)) {
- if (last_mouse_location_in_screen.x() < dst_bounds.x())
- dst_bounds.set_x(last_mouse_location_in_screen.x());
- else if (last_mouse_location_in_screen.x() > dst_bounds.right())
- dst_bounds.set_x(
- last_mouse_location_in_screen.x() - dst_bounds.width());
- }
+ const gfx::Rect dst_bounds =
+ ScreenAsh::ConvertRectToScreen(GetTarget()->parent(),
+ GetTarget()->bounds());
GetTarget()->SetBoundsInScreen(dst_bounds, dst_display);
}
}
« no previous file with comments | « trunk/src/ash/root_window_controller_unittest.cc ('k') | trunk/src/ash/wm/drag_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698