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

Unified Diff: ash/wm/window_resizer.cc

Issue 11364052: Revert "Disabled WorkspaceWindowResizerTest.Edge since it got broken by https://chromiumcodereview.… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « ash/wm/window_resizer.h ('k') | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ash/wm/window_resizer.h ('k') | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698