| OLD | NEW | 
|---|
| 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/window_resizer.h" | 5 #include "ash/wm/window_resizer.h" | 
| 6 | 6 | 
| 7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" | 
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" | 
| 9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" | 
| 10 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" | 
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 197   gfx::Size size = GetSizeForDrag(details, &delta_x, &delta_y, grid_size); | 197   gfx::Size size = GetSizeForDrag(details, &delta_x, &delta_y, grid_size); | 
| 198   gfx::Point origin = GetOriginForDrag(details, delta_x, delta_y); | 198   gfx::Point origin = GetOriginForDrag(details, delta_x, delta_y); | 
| 199 | 199 | 
| 200   gfx::Rect new_bounds(origin, size); | 200   gfx::Rect new_bounds(origin, size); | 
| 201   // Update bottom edge to stay in the work area when we are resizing | 201   // Update bottom edge to stay in the work area when we are resizing | 
| 202   // by dragging the bottome edge or corners. | 202   // by dragging the bottome edge or corners. | 
| 203   if (details.window_component == HTBOTTOM || | 203   if (details.window_component == HTBOTTOM || | 
| 204       details.window_component == HTBOTTOMRIGHT || | 204       details.window_component == HTBOTTOMRIGHT || | 
| 205       details.window_component == HTBOTTOMLEFT) { | 205       details.window_component == HTBOTTOMLEFT) { | 
| 206     gfx::Rect work_area = | 206     gfx::Rect work_area = | 
| 207         ScreenAsh::GetDisplayWorkAreaParentBounds(details.window); | 207         ScreenAsh::GetDisplayWorkAreaBoundsInParent(details.window); | 
| 208     if (new_bounds.bottom() > work_area.bottom()) | 208     if (new_bounds.bottom() > work_area.bottom()) | 
| 209       new_bounds.Inset(0, 0, 0, | 209       new_bounds.Inset(0, 0, 0, | 
| 210                        new_bounds.bottom() - work_area.bottom()); | 210                        new_bounds.bottom() - work_area.bottom()); | 
| 211   } | 211   } | 
| 212   if (details.bounds_change & kBoundsChange_Resizes && | 212   if (details.bounds_change & kBoundsChange_Resizes && | 
| 213       details.bounds_change & kBoundsChange_Repositions && new_bounds.y() < 0) { | 213       details.bounds_change & kBoundsChange_Repositions && new_bounds.y() < 0) { | 
| 214     int delta = new_bounds.y(); | 214     int delta = new_bounds.y(); | 
| 215     new_bounds.set_y(0); | 215     new_bounds.set_y(0); | 
| 216     new_bounds.set_height(new_bounds.height() + delta); | 216     new_bounds.set_height(new_bounds.height() + delta); | 
| 217   } | 217   } | 
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 332         gfx::Screen::GetDisplayNearestWindow(details.window).bounds().height(); | 332         gfx::Screen::GetDisplayNearestWindow(details.window).bounds().height(); | 
| 333     if (height > max_height) { | 333     if (height > max_height) { | 
| 334       height = max_height; | 334       height = max_height; | 
| 335       *delta_y = -y_multiplier * (details.initial_bounds.height() - max_height); | 335       *delta_y = -y_multiplier * (details.initial_bounds.height() - max_height); | 
| 336     } | 336     } | 
| 337   } | 337   } | 
| 338   return height; | 338   return height; | 
| 339 } | 339 } | 
| 340 | 340 | 
| 341 }  // namespace aura | 341 }  // namespace aura | 
| OLD | NEW | 
|---|