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

Unified Diff: ui/aura/toplevel_window_event_filter.cc

Issue 8273040: Minimum size for aura window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 2 months 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: ui/aura/toplevel_window_event_filter.cc
diff --git a/ui/aura/toplevel_window_event_filter.cc b/ui/aura/toplevel_window_event_filter.cc
index 98d29d302ca3d7e22f83460086447e22a07668d6..5a08b7f28d06e8b759cbe415e6bd7493231da1e8 100644
--- a/ui/aura/toplevel_window_event_filter.cc
+++ b/ui/aura/toplevel_window_event_filter.cc
@@ -232,10 +232,17 @@ gfx::Size ToplevelWindowEventFilter::GetSizeForDrag(int bounds_change,
int x_multiplier = GetXMultiplierForWindowComponent(window_component_);
int y_multiplier = GetYMultiplierForWindowComponent(window_component_);
- size.Enlarge(size_change_direction & kBoundsChangeDirection_Horizontal ?
- x_multiplier * (first_x - second_x) : 0,
- size_change_direction & kBoundsChangeDirection_Vertical ?
- y_multiplier * (first_y - second_y) : 0);
+
+ int width = size.width() +
+ (size_change_direction & kBoundsChangeDirection_Horizontal ?
+ x_multiplier * (first_x - second_x) : 0);
+ int height = size.height() +
+ (size_change_direction & kBoundsChangeDirection_Vertical ?
+ y_multiplier * (first_y - second_y) : 0);
Ben Goodger (Google) 2011/10/14 15:40:05 insert a newline after this line
+ const gfx::Size min_size = target->minimum_size();
+ // Window should have minimum window size.
Ben Goodger (Google) 2011/10/14 15:40:05 Move this comment above the previous line. Reword
+ size.SetSize(std::max(width, min_size.width()),
+ std::max(height, min_size.height()));
}
return size;
}
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/aura/window.h » ('j') | ui/aura/window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698