Index: ash/wm/dock/docked_window_layout_manager.cc |
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc |
index 063c467c9cb70c08fda104e119c7cd8a4dbb05a8..daddd1f419c8c261868cf28cd99c71f666460990 100644 |
--- a/ash/wm/dock/docked_window_layout_manager.cc |
+++ b/ash/wm/dock/docked_window_layout_manager.cc |
@@ -707,8 +707,17 @@ void DockedWindowLayoutManager::OnChildWindowVisibilityChanged( |
void DockedWindowLayoutManager::SetChildBounds( |
aura::Window* child, |
const gfx::Rect& requested_bounds) { |
+ // The minimum constraints have to be applied first by the layout manager. |
+ gfx::Rect actual_new_bounds(requested_bounds); |
+ if (child->delegate()) { |
+ const gfx::Size& min_size = child->delegate()->GetMinimumSize(); |
+ actual_new_bounds.set_width( |
+ std::max(min_size.width(), actual_new_bounds.width())); |
+ actual_new_bounds.set_height( |
+ std::max(min_size.height(), actual_new_bounds.height())); |
+ } |
// Whenever one of our windows is moved or resized enforce layout. |
- SetChildBoundsDirect(child, requested_bounds); |
+ SetChildBoundsDirect(child, actual_new_bounds); |
if (IsPopupOrTransient(child)) |
return; |
ShelfLayoutManager* shelf_layout = |