diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-02 17:13:04 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-02 17:13:04 +0000 |
commit | a464db4991c68aa22a39ea96b16660c7b8ee724a (patch) | |
tree | 170a66ff8507204c6592151c3e62ff8518fd92e2 /ash/wm/window_resizer.cc | |
parent | 267e0d64df635791d4e32334e1927a32f5a9212c (diff) | |
download | chromium_src-a464db4991c68aa22a39ea96b16660c7b8ee724a.zip chromium_src-a464db4991c68aa22a39ea96b16660c7b8ee724a.tar.gz chromium_src-a464db4991c68aa22a39ea96b16660c7b8ee724a.tar.bz2 |
Revert "Disabled WorkspaceWindowResizerTest.Edge since it got broken by https://chromiumcodereview.appspot.com/11369017."
This reverts commit 56a8db65b684c720a5ba5f87887584fa7b6bfe5f.
Revert "Use correct restore bounds in resizer."
This reverts commit 058c98f24ffc5d8fc1f89580fa4c39ba5441905e.
TBR=oshima
BUG=none
Review URL: https://codereview.chromium.org/11364052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/window_resizer.cc')
-rw-r--r-- | ash/wm/window_resizer.cc | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc index a0dec72..ef44c9b 100644 --- a/ash/wm/window_resizer.cc +++ b/ash/wm/window_resizer.cc @@ -114,18 +114,18 @@ WindowResizer::Details::Details() WindowResizer::Details::Details(aura::Window* window, const gfx::Point& location, int window_component) - : window(window), - initial_bounds_in_parent(window->bounds()), - restore_bounds(gfx::Rect()), - initial_location_in_parent(location), - initial_opacity(window->layer()->opacity()), - window_component(window_component), - bounds_change(GetBoundsChangeForWindowComponent(window_component)), - position_change_direction( - GetPositionChangeDirectionForWindowComponent(window_component)), - size_change_direction( - GetSizeChangeDirectionForWindowComponent(window_component)), - is_resizable(bounds_change != kBoundsChangeDirection_None) { + : window(window), + initial_bounds(window->bounds()), + restore_bounds(gfx::Rect()), + initial_location_in_parent(location), + initial_opacity(window->layer()->opacity()), + window_component(window_component), + bounds_change(GetBoundsChangeForWindowComponent(window_component)), + position_change_direction( + GetPositionChangeDirectionForWindowComponent(window_component)), + size_change_direction( + GetSizeChangeDirectionForWindowComponent(window_component)), + is_resizable(bounds_change != kBoundsChangeDirection_None) { if (wm::IsWindowNormal(window) && GetRestoreBoundsInScreen(window) && window_component == HTCAPTION) @@ -173,7 +173,7 @@ gfx::Rect WindowResizer::CalculateBoundsForDrag( const Details& details, const gfx::Point& passed_location) { if (!details.is_resizable) - return details.initial_bounds_in_parent; + return details.initial_bounds; gfx::Point location = passed_location; gfx::Rect work_area = @@ -237,7 +237,7 @@ gfx::Rect WindowResizer::CalculateBoundsForDrag( // However - it is not desirable to change the origin if the window would // be still hit by the cursor. if (details.initial_location_in_parent.x() > - details.initial_bounds_in_parent.x() + details.restore_bounds.width()) + details.initial_bounds.x() + details.restore_bounds.width()) new_bounds.set_x(location.x() - details.restore_bounds.width() / 2); } @@ -277,7 +277,7 @@ bool WindowResizer::IsBottomEdge(int window_component) { gfx::Point WindowResizer::GetOriginForDrag(const Details& details, int delta_x, int delta_y) { - gfx::Point origin = details.initial_bounds_in_parent.origin(); + gfx::Point origin = details.initial_bounds.origin(); if (details.bounds_change & kBoundsChange_Repositions) { int pos_change_direction = GetPositionChangeDirectionForWindowComponent(details.window_component); @@ -293,7 +293,7 @@ gfx::Point WindowResizer::GetOriginForDrag(const Details& details, gfx::Size WindowResizer::GetSizeForDrag(const Details& details, int* delta_x, int* delta_y) { - gfx::Size size = details.initial_bounds_in_parent.size(); + gfx::Size size = details.initial_bounds.size(); if (details.bounds_change & kBoundsChange_Resizes) { gfx::Size min_size = details.window->delegate()->GetMinimumSize(); size.SetSize(GetWidthForDrag(details, min_size.width(), delta_x), @@ -308,7 +308,7 @@ gfx::Size WindowResizer::GetSizeForDrag(const Details& details, int WindowResizer::GetWidthForDrag(const Details& details, int min_width, int* delta_x) { - int width = details.initial_bounds_in_parent.width(); + int width = details.initial_bounds.width(); if (details.size_change_direction & kBoundsChangeDirection_Horizontal) { // Along the right edge, positive delta_x increases the window size. int x_multiplier = IsRightEdge(details.window_component) ? 1 : -1; @@ -318,8 +318,7 @@ int WindowResizer::GetWidthForDrag(const Details& details, // for the window origin computation. if (width < min_width) { width = min_width; - *delta_x = -x_multiplier * (details.initial_bounds_in_parent.width() - - min_width); + *delta_x = -x_multiplier * (details.initial_bounds.width() - min_width); } // And don't let the window go bigger than the display. @@ -327,8 +326,7 @@ int WindowResizer::GetWidthForDrag(const Details& details, details.window).bounds().width(); if (width > max_width) { width = max_width; - *delta_x = -x_multiplier * (details.initial_bounds_in_parent.width() - - max_width); + *delta_x = -x_multiplier * (details.initial_bounds.width() - max_width); } } return width; @@ -338,7 +336,7 @@ int WindowResizer::GetWidthForDrag(const Details& details, int WindowResizer::GetHeightForDrag(const Details& details, int min_height, int* delta_y) { - int height = details.initial_bounds_in_parent.height(); + int height = details.initial_bounds.height(); if (details.size_change_direction & kBoundsChangeDirection_Vertical) { // Along the bottom edge, positive delta_y increases the window size. int y_multiplier = IsBottomEdge(details.window_component) ? 1 : -1; @@ -348,8 +346,7 @@ int WindowResizer::GetHeightForDrag(const Details& details, // for the window origin computation. if (height < min_height) { height = min_height; - *delta_y = -y_multiplier * (details.initial_bounds_in_parent.height() - - min_height); + *delta_y = -y_multiplier * (details.initial_bounds.height() - min_height); } // And don't let the window go bigger than the display. @@ -357,8 +354,7 @@ int WindowResizer::GetHeightForDrag(const Details& details, details.window).bounds().height(); if (height > max_height) { height = max_height; - *delta_y = -y_multiplier * (details.initial_bounds_in_parent.height() - - max_height); + *delta_y = -y_multiplier * (details.initial_bounds.height() - max_height); } } return height; |