Chromium Code Reviews| Index: ash/wm/window_resizer.cc |
| diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc |
| index 623be33368d37c62f586e765b8446787987e5609..0ecadc475ecf1182bf83d473027bd8962b6798a3 100644 |
| --- a/ash/wm/window_resizer.cc |
| +++ b/ash/wm/window_resizer.cc |
| @@ -6,6 +6,8 @@ |
| #include "ash/screen_ash.h" |
| #include "ash/shell.h" |
| +#include "ash/wm/property_util.h" |
| +#include "ash/wm/window_util.h" |
| #include "ui/aura/client/aura_constants.h" |
| #include "ui/aura/root_window.h" |
| #include "ui/aura/window.h" |
| @@ -100,6 +102,7 @@ const int WindowResizer::kBoundsChangeDirection_Vertical = 2; |
| WindowResizer::Details::Details() |
| : window(NULL), |
| + restore_bounds(gfx::Rect()), |
| window_component(HTNOWHERE), |
| bounds_change(0), |
| position_change_direction(0), |
| @@ -112,6 +115,7 @@ WindowResizer::Details::Details(aura::Window* window, |
| int window_component) |
| : window(window), |
| initial_bounds(window->bounds()), |
| + restore_bounds(gfx::Rect()), |
| initial_location_in_parent(location), |
| initial_opacity(window->layer()->opacity()), |
| window_component(window_component), |
| @@ -121,6 +125,10 @@ WindowResizer::Details::Details(aura::Window* window, |
| size_change_direction( |
| GetSizeChangeDirectionForWindowComponent(window_component)), |
| is_resizable(bounds_change != kBoundsChangeDirection_None) { |
| + if (wm::IsWindowNormal(window) && |
| + GetRestoreBoundsInScreen(window) && |
| + window_component == HTCAPTION) |
| + restore_bounds = *GetRestoreBoundsInScreen(window); |
| } |
| WindowResizer::Details::~Details() { |
| @@ -267,6 +275,9 @@ gfx::Size WindowResizer::GetSizeForDrag(const Details& details, |
| grid_size), |
| GetHeightForDrag(details, min_size.height(), delta_y, |
| grid_size)); |
| + } else { |
| + if (!details.restore_bounds.IsEmpty()) |
| + size = details.restore_bounds.size(); |
|
sky
2012/09/06 19:45:11
You may need to adjust the origin too. Consider th
Mr4D (OOO till 08-26)
2012/09/06 23:16:13
I was first tempted to say that this was taken car
|
| } |
| return size; |
| } |