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

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 DesktopNativeWidgetAura 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/frame_painter.cc ('k') | ash/wm/window_util.h » ('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 16070e7eaa21b9bb2048cdb2642a593b9cbcf283..3773d0735099072ee932d1ffc915df274181a16b 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() -
« no previous file with comments | « ash/wm/frame_painter.cc ('k') | ash/wm/window_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698