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

Unified Diff: ash/wm/dock/docked_window_layout_manager.cc

Issue 105673008: Remove unneeded ScopedLayerAnimationSettings::LockTransitionDuration() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.h ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 715113b5b090d6f5408bc1a2cac41015a0ad0651..9cc7eefe96f4ed96d4d4483428f62c479336d386 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -514,12 +514,18 @@ void DockedWindowLayoutManager::FinishDragging(DockedAction action,
wm::GetWindowState(dragged_window_)->RemoveObserver(this);
if (last_active_window_ == dragged_window_)
last_active_window_ = NULL;
+
+ views::corewm::SetWindowShowAnimationDuration(dragged_window_,
+ base::TimeDelta());
} else {
// A window is no longer dragged and is a child.
// When a window becomes a child at drag start this is
// the only opportunity we will have to enforce a window
// count limit so do it here.
MaybeMinimizeChildrenExcept(dragged_window_);
+
+ views::corewm::SetWindowShowAnimationDuration(dragged_window_,
+ base::TimeDelta::FromMilliseconds(kFadeDurationMs));
}
dragged_window_ = NULL;
dragged_bounds_ = gfx::Rect();
@@ -658,6 +664,8 @@ void DockedWindowLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
wm::GetWindowState(child)->AddObserver(this);
Relayout();
UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED);
+ views::corewm::SetWindowShowAnimationDuration(child,
+ base::TimeDelta::FromMilliseconds(kFadeDurationMs));
}
void DockedWindowLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {
@@ -679,6 +687,7 @@ void DockedWindowLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {
wm::GetWindowState(child)->RemoveObserver(this);
Relayout();
UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED);
+ views::corewm::SetWindowShowAnimationDuration(child, base::TimeDelta());
}
void DockedWindowLayoutManager::OnChildWindowVisibilityChanged(
@@ -817,21 +826,6 @@ void DockedWindowLayoutManager::OnWindowBoundsChanged(
Relayout();
}
-void DockedWindowLayoutManager::OnWindowVisibilityChanging(
- aura::Window* window, bool visible) {
- if (IsPopupOrTransient(window))
- return;
- int animation_type = views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT;
- if (visible) {
- animation_type = views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_DROP;
- views::corewm::SetWindowVisibilityAnimationDuration(
- window, base::TimeDelta::FromMilliseconds(kFadeDurationMs));
- } else if (wm::GetWindowState(window)->IsMinimized()) {
- animation_type = WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE;
- }
- views::corewm::SetWindowVisibilityAnimationType(window, animation_type);
-}
-
void DockedWindowLayoutManager::OnWindowDestroying(aura::Window* window) {
if (dragged_window_ == window) {
FinishDragging(DOCKED_ACTION_NONE, DOCKED_ACTION_SOURCE_UNKNOWN);
@@ -890,21 +884,25 @@ void DockedWindowLayoutManager::MaybeMinimizeChildrenExcept(
if (available_room > room_needed) {
available_room -= room_needed;
} 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(
+ // Slow down the minimize animation.
+ views::corewm::SetWindowHideAnimationDuration(
+ window,
base::TimeDelta::FromMilliseconds(kMinimizeDurationMs));
- settings.LockTransitionDuration();
wm::GetWindowState(window)->Minimize();
+ views::corewm::SetWindowHideAnimationDuration(window, base::TimeDelta());
}
}
}
void DockedWindowLayoutManager::MinimizeDockedWindow(
wm::WindowState* window_state) {
- DCHECK(!IsPopupOrTransient(window_state->window()));
- window_state->window()->Hide();
+ aura::Window* window = window_state->window();
+ DCHECK(!IsPopupOrTransient(window));
+ views::corewm::SetWindowVisibilityAnimationType(window,
+ ash::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE);
+ window->Hide();
+ views::corewm::SetWindowVisibilityAnimationType(window,
+ views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT);
if (window_state->IsActive())
window_state->Deactivate();
RecordUmaAction(DOCKED_ACTION_MINIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN);
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.h ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698