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

Unified Diff: ash/wm/window_resizer.cc

Issue 11366215: Prevents windows in chromeos from resizing bigger than their maximum size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments 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
Index: ash/wm/window_resizer.cc
diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc
index 16070e7eaa21b9bb2048cdb2642a593b9cbcf283..51fca5b07fd6fd0589592c794241ca657a47c558 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.IsEmpty())
jeremya 2012/11/15 01:12:43 Perhaps you only want to check the max width here?
koz (OOO until 15th September) 2012/11/15 02:46:13 Good catch. Fixed here and below.
+ 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.IsEmpty())
+ 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() -

Powered by Google App Engine
This is Rietveld 408576698