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 f4a2e2629b8225e442dd4d20bfe8a30714acf783..08990a093df8850dea2306d05b4ebd693b7813b2 100644 |
--- a/ash/wm/dock/docked_window_layout_manager.cc |
+++ b/ash/wm/dock/docked_window_layout_manager.cc |
@@ -45,7 +45,8 @@ const int DockedWindowLayoutManager::kMinDockGap = 2; |
const int DockedWindowLayoutManager::kIdealWidth = 250; |
const int kMinimumHeight = 250; |
const int kSlideDurationMs = 120; |
-const int kFadeDurationMs = 720; |
+const int kFadeDurationMs = 60; |
+const int kMinimizeDurationMs = 720; |
namespace { |
@@ -653,10 +654,17 @@ void DockedWindowLayoutManager::MaybeMinimizeChildrenExcept( |
if (window == child || !IsUsedByLayout(window)) |
continue; |
int room_needed = GetWindowHeightCloseTo(window, 0) + kMinDockGap; |
- if (available_room > room_needed) |
+ if (available_room > room_needed) { |
available_room -= room_needed; |
- else |
+ } else { |
+ // Slow down minimizing animations. Lock duration so that it is not |
+ // overridden by other ScopedLayerAnimationSettings down the stack. |
+ ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); |
+ settings.SetTransitionDuration( |
+ base::TimeDelta::FromMilliseconds(kMinimizeDurationMs)); |
+ settings.SetTransitionDurationLocked(true); |
wm::GetWindowState(window)->Minimize(); |
+ } |
} |
} |
@@ -673,7 +681,7 @@ void DockedWindowLayoutManager::RestoreDockedWindow( |
wm::WindowState* window_state) { |
aura::Window* window = window_state->window(); |
DCHECK(!IsPopupOrTransient(window)); |
- // Always place restored window at the top shuffling the other windows down. |
+ // Always place restored window at the bottom shuffling the other windows up. |
// TODO(varkha): add a separate container for docked windows to keep track |
// of ordering. |
gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( |
@@ -687,7 +695,7 @@ void DockedWindowLayoutManager::RestoreDockedWindow( |
return; |
} |
gfx::Rect bounds(window->bounds()); |
- bounds.set_y(work_area.y() - bounds.height()); |
+ bounds.set_y(work_area.bottom()); |
window->SetBounds(bounds); |
window->Show(); |
MaybeMinimizeChildrenExcept(window); |