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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 | 116 |
117 // Hides a window using an animation, animating its opacity from 1.f to 0.f, and | 117 // Hides a window using an animation, animating its opacity from 1.f to 0.f, and |
118 // its transform to |end_transform|. | 118 // its transform to |end_transform|. |
119 void AnimateHideWindowCommon(aura::Window* window, | 119 void AnimateHideWindowCommon(aura::Window* window, |
120 const ui::Transform& end_transform) { | 120 const ui::Transform& end_transform) { |
121 window->layer()->set_delegate(NULL); | 121 window->layer()->set_delegate(NULL); |
122 | 122 |
123 // Property sets within this scope will be implicitly animated. | 123 // Property sets within this scope will be implicitly animated. |
124 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); | 124 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); |
125 settings.AddImplicitObserver(new HidingWindowAnimationObserver(window)); | 125 settings.AddObserver(new HidingWindowAnimationObserver(window)); |
126 | 126 |
127 window->layer()->SetOpacity(kWindowAnimation_HideOpacity); | 127 window->layer()->SetOpacity(kWindowAnimation_HideOpacity); |
128 window->layer()->SetTransform(end_transform); | 128 window->layer()->SetTransform(end_transform); |
129 } | 129 } |
130 | 130 |
131 // Show/Hide windows using a shrink animation. | 131 // Show/Hide windows using a shrink animation. |
132 void AnimateShowWindow_Drop(aura::Window* window) { | 132 void AnimateShowWindow_Drop(aura::Window* window) { |
133 ui::Transform transform; | 133 ui::Transform transform; |
134 transform.ConcatScale(kWindowAnimation_ScaleFactor, | 134 transform.ConcatScale(kWindowAnimation_ScaleFactor, |
135 kWindowAnimation_ScaleFactor); | 135 kWindowAnimation_ScaleFactor); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 AnimateShowWindow(window); | 217 AnimateShowWindow(window); |
218 } else { | 218 } else { |
219 // Don't start hiding the window again if it's already being hidden. | 219 // Don't start hiding the window again if it's already being hidden. |
220 if (window->layer()->GetTargetOpacity() != 0.0f) | 220 if (window->layer()->GetTargetOpacity() != 0.0f) |
221 AnimateHideWindow(window); | 221 AnimateHideWindow(window); |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 } // namespace internal | 225 } // namespace internal |
226 } // namespace ash | 226 } // namespace ash |
OLD | NEW |