OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/window_animations.h" | 5 #include "ash/wm/window_animations.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // its transform to |end_transform|. | 117 // its transform to |end_transform|. |
118 void AnimateHideWindowCommon(aura::Window* window, | 118 void AnimateHideWindowCommon(aura::Window* window, |
119 const ui::Transform& end_transform) { | 119 const ui::Transform& end_transform) { |
120 // The window's layer was just hidden, but we need it to draw until it's fully | 120 // The window's layer was just hidden, but we need it to draw until it's fully |
121 // transparent, so we show it again. This is undone once the animation is | 121 // transparent, so we show it again. This is undone once the animation is |
122 // complete. | 122 // complete. |
123 window->layer()->SetVisible(true); | 123 window->layer()->SetVisible(true); |
124 { | 124 { |
125 // Property sets within this scope will be implicitly animated. | 125 // Property sets within this scope will be implicitly animated. |
126 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); | 126 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); |
127 settings.AddImplicitObserver(new HidingWindowAnimationObserver(window)); | 127 settings.AddObserver(new HidingWindowAnimationObserver(window)); |
128 | 128 |
129 window->layer()->SetOpacity(kWindowAnimation_HideOpacity); | 129 window->layer()->SetOpacity(kWindowAnimation_HideOpacity); |
130 window->layer()->SetTransform(end_transform); | 130 window->layer()->SetTransform(end_transform); |
131 } | 131 } |
132 } | 132 } |
133 | 133 |
134 // Show/Hide windows using a shrink animation. | 134 // Show/Hide windows using a shrink animation. |
135 void AnimateShowWindow_Drop(aura::Window* window) { | 135 void AnimateShowWindow_Drop(aura::Window* window) { |
136 ui::Transform transform; | 136 ui::Transform transform; |
137 transform.ConcatScale(kWindowAnimation_ScaleFactor, | 137 transform.ConcatScale(kWindowAnimation_ScaleFactor, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 AnimateShowWindow(window); | 220 AnimateShowWindow(window); |
221 } else { | 221 } else { |
222 // Don't start hiding the window again if it's already being hidden. | 222 // Don't start hiding the window again if it's already being hidden. |
223 if (window->layer()->GetTargetOpacity() != 0.0f) | 223 if (window->layer()->GetTargetOpacity() != 0.0f) |
224 AnimateHideWindow(window); | 224 AnimateHideWindow(window); |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 } // namespace internal | 228 } // namespace internal |
229 } // namespace ash | 229 } // namespace ash |
OLD | NEW |