Index: ash/wm/window_resizer.cc |
diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc |
index a0dec729971756b6ae35247cfb3b639be0b3c880..ef44c9bac6b5d232978fe02e8e5153961e4426d5 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; |