summaryrefslogtreecommitdiffstats
path: root/ash/wm/window_resizer.cc
diff options
context:
space:
mode:
authorkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-26 04:11:38 +0000
committerkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-26 04:11:38 +0000
commitfa574b64c7b7b7b1c23b0407bec6dbd0e76f677b (patch)
tree83b85a315560d769a01b2b6de66ea5ee289daeba /ash/wm/window_resizer.cc
parent3da11ba65d3bb24a0634bf0e502b22a5ecb81d4b (diff)
downloadchromium_src-fa574b64c7b7b7b1c23b0407bec6dbd0e76f677b.zip
chromium_src-fa574b64c7b7b7b1c23b0407bec6dbd0e76f677b.tar.gz
chromium_src-fa574b64c7b7b7b1c23b0407bec6dbd0e76f677b.tar.bz2
Makes windows obey their maximum size constraints on chromeos.
- Prevents windows from resizing bigger than their max size - Prevents windows from snapping when they have max size defined - Prevents windows from maximizing when they have max size defined BUG=152065 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=168447 Review URL: https://chromiumcodereview.appspot.com/11366215 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169402 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/window_resizer.cc')
-rw-r--r--ash/wm/window_resizer.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc
index 16070e7..3773d07 100644
--- a/ash/wm/window_resizer.cc
+++ b/ash/wm/window_resizer.cc
@@ -324,6 +324,9 @@ int WindowResizer::GetWidthForDrag(const Details& details,
// And don't let the window go bigger than the display.
int max_width = Shell::GetScreen()->GetDisplayNearestWindow(
details.window).bounds().width();
+ gfx::Size max_size = details.window->delegate()->GetMaximumSize();
+ if (max_size.width() != 0)
+ max_width = std::min(max_width, max_size.width());
if (width > max_width) {
width = max_width;
*delta_x = -x_multiplier * (details.initial_bounds_in_parent.width() -
@@ -354,6 +357,9 @@ int WindowResizer::GetHeightForDrag(const Details& details,
// And don't let the window go bigger than the display.
int max_height = Shell::GetScreen()->GetDisplayNearestWindow(
details.window).bounds().height();
+ gfx::Size max_size = details.window->delegate()->GetMaximumSize();
+ if (max_size.height() != 0)
+ max_height = std::min(max_height, max_size.height());
if (height > max_height) {
height = max_height;
*delta_y = -y_multiplier * (details.initial_bounds_in_parent.height() -