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

Unified Diff: ash/wm/window_animations.cc

Issue 180273025: Keep dedicated layers for hiding animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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: ash/wm/window_animations.cc
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index a5b36530bfdb7507be582c7aa579ed0c91261ad5..18a6fa10b349e5e19d408a16a8ff6733ce27d022 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -173,12 +173,10 @@ void AnimateHideWindow_Minimize(aura::Window* window) {
window->layer()->set_delegate(NULL);
// Property sets within this scope will be implicitly animated.
- ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
+ views::corewm::ScopedHidingAnimationSettings hiding_settings(window);
base::TimeDelta duration = base::TimeDelta::FromMilliseconds(
kLayerAnimationsForMinimizeDurationMS);
- settings.SetTransitionDuration(duration);
- settings.AddObserver(
- views::corewm::CreateHidingWindowAnimationObserver(window));
+ hiding_settings.layer_animation_settings()->SetTransitionDuration(duration);
window->layer()->SetVisible(false);
AddLayerAnimationsForMinimize(window, false);
@@ -207,17 +205,16 @@ void AnimateShowHideWindowCommon_BrightnessGrayscale(aura::Window* window,
base::TimeDelta duration =
base::TimeDelta::FromMilliseconds(kBrightnessGrayscaleFadeDurationMs);
- ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
- settings.SetTransitionDuration(duration);
- if (!show) {
- settings.AddObserver(
- views::corewm::CreateHidingWindowAnimationObserver(window));
- }
-
- window->layer()->GetAnimator()->
- ScheduleTogether(
- CreateBrightnessGrayscaleAnimationSequence(end_value, duration));
- if (!show) {
+ if (show) {
+ ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
+ window->layer()->GetAnimator()->
+ ScheduleTogether(
+ CreateBrightnessGrayscaleAnimationSequence(end_value, duration));
+ } else {
+ views::corewm::ScopedHidingAnimationSettings hiding_settings(window);
+ window->layer()->GetAnimator()->
+ ScheduleTogether(
+ CreateBrightnessGrayscaleAnimationSequence(end_value, duration));
window->layer()->SetOpacity(kWindowAnimation_HideOpacity);
window->layer()->SetVisible(false);
}

Powered by Google App Engine
This is Rietveld 408576698