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/desktop_background/desktop_background_view.h" | 5 #include "ash/desktop_background/desktop_background_view.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 views::corewm::SetWindowVisibilityAnimationType( | 194 views::corewm::SetWindowVisibilityAnimationType( |
195 desktop_widget->GetNativeView(), animation_type); | 195 desktop_widget->GetNativeView(), animation_type); |
196 | 196 |
197 // Enable wallpaper transition for the following cases: | 197 // Enable wallpaper transition for the following cases: |
198 // 1. Initial(OOBE) wallpaper animation. | 198 // 1. Initial(OOBE) wallpaper animation. |
199 // 2. Wallpaper fades in from a non empty background. | 199 // 2. Wallpaper fades in from a non empty background. |
200 // 3. From an empty background, chrome transit to a logged in user session. | 200 // 3. From an empty background, chrome transit to a logged in user session. |
201 // 4. From an empty background, guest user logged in. | 201 // 4. From an empty background, guest user logged in. |
202 if (wallpaper_delegate->ShouldShowInitialAnimation() || | 202 if (wallpaper_delegate->ShouldShowInitialAnimation() || |
203 root_window->GetProperty(kAnimatingDesktopController) || | 203 root_window->GetProperty(kAnimatingDesktopController) || |
204 Shell::GetInstance()->session_state_delegate()->HasActiveUser()) { | 204 Shell::GetInstance()->session_state_delegate()->NumberOfLoggedInUsers()) { |
205 views::corewm::SetWindowVisibilityAnimationTransition( | 205 views::corewm::SetWindowVisibilityAnimationTransition( |
206 desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); | 206 desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); |
207 } else { | 207 } else { |
208 // Disable animation if transition to login screen from an empty background. | 208 // Disable animation if transition to login screen from an empty background. |
209 views::corewm::SetWindowVisibilityAnimationTransition( | 209 views::corewm::SetWindowVisibilityAnimationTransition( |
210 desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); | 210 desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); |
211 } | 211 } |
212 | 212 |
213 desktop_widget->SetBounds(params.parent->bounds()); | 213 desktop_widget->SetBounds(params.parent->bounds()); |
214 ui::ScopedLayerAnimationSettings settings( | 214 ui::ScopedLayerAnimationSettings settings( |
215 desktop_widget->GetNativeView()->layer()->GetAnimator()); | 215 desktop_widget->GetNativeView()->layer()->GetAnimator()); |
216 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); | 216 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); |
217 settings.AddObserver(new ShowWallpaperAnimationObserver( | 217 settings.AddObserver(new ShowWallpaperAnimationObserver( |
218 root_window, desktop_widget, | 218 root_window, desktop_widget, |
219 wallpaper_delegate->ShouldShowInitialAnimation())); | 219 wallpaper_delegate->ShouldShowInitialAnimation())); |
220 desktop_widget->Show(); | 220 desktop_widget->Show(); |
221 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); | 221 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); |
222 return desktop_widget; | 222 return desktop_widget; |
223 } | 223 } |
224 | 224 |
225 } // namespace internal | 225 } // namespace internal |
226 } // namespace ash | 226 } // namespace ash |
OLD | NEW |