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/session_state_animator.h" | 5 #include "ash/wm/session_state_animator.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
10 #include "ash/wm/workspace/workspace_animations.h" | 10 #include "ash/wm/workspace/workspace_animations.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 void HideWindow(aura::Window* window, | 154 void HideWindow(aura::Window* window, |
155 base::TimeDelta duration, | 155 base::TimeDelta duration, |
156 WorkspaceAnimationDirection direction, | 156 WorkspaceAnimationDirection direction, |
157 ui::LayerAnimationObserver* observer) { | 157 ui::LayerAnimationObserver* observer) { |
158 WorkspaceAnimationDetails details; | 158 WorkspaceAnimationDetails details; |
159 details.direction = direction; | 159 details.direction = direction; |
160 details.animate = true; | 160 details.animate = true; |
161 details.animate_scale = true; | 161 details.animate_scale = true; |
162 details.animate_opacity = true; | 162 details.animate_opacity = true; |
163 details.duration = duration; | 163 details.duration = duration; |
| 164 details.can_be_cancelled = true; |
164 HideWorkspace(window, details); | 165 HideWorkspace(window, details); |
165 // A bit of a dirty trick: we need to catch the end of the animation we don't | 166 // A bit of a dirty trick: we need to catch the end of the animation we don't |
166 // control. So we use two facts we know: which animator will be used and the | 167 // control. So we use two facts we know: which animator will be used and the |
167 // target opacity to add "Do nothing" animation sequence. | 168 // target opacity to add "Do nothing" animation sequence. |
168 // Unfortunately, we can not just use empty LayerAnimationSequence, because | 169 // Unfortunately, we can not just use empty LayerAnimationSequence, because |
169 // it does not call NotifyEnded(). | 170 // it does not call NotifyEnded(). |
170 ui::LayerAnimationSequence* sequence = new ui::LayerAnimationSequence( | 171 ui::LayerAnimationSequence* sequence = new ui::LayerAnimationSequence( |
171 ui::LayerAnimationElement::CreateOpacityElement( | 172 ui::LayerAnimationElement::CreateOpacityElement( |
172 0.0, base::TimeDelta())); | 173 0.0, base::TimeDelta())); |
173 if (observer) | 174 if (observer) |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 foreground_->SetColor(SK_ColorWHITE); | 546 foreground_->SetColor(SK_ColorWHITE); |
546 foreground_->GetWidget()->Show(); | 547 foreground_->GetWidget()->Show(); |
547 } | 548 } |
548 | 549 |
549 void SessionStateAnimator::DropForeground() { | 550 void SessionStateAnimator::DropForeground() { |
550 foreground_.reset(); | 551 foreground_.reset(); |
551 } | 552 } |
552 | 553 |
553 } // namespace internal | 554 } // namespace internal |
554 } // namespace ash | 555 } // namespace ash |
OLD | NEW |