diff options
author | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-19 16:29:59 +0000 |
---|---|---|
committer | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-19 16:29:59 +0000 |
commit | 363b7ab54e301110dfb6c823a7a51d53871132af (patch) | |
tree | 5627fffdd0d52943f57cc6b44ada2ee795c28ee3 /ash/desktop_background/desktop_background_view.cc | |
parent | da9ea8806cb873eff6d6c2e6215f36514b62aa90 (diff) | |
download | chromium_src-363b7ab54e301110dfb6c823a7a51d53871132af.zip chromium_src-363b7ab54e301110dfb6c823a7a51d53871132af.tar.gz chromium_src-363b7ab54e301110dfb6c823a7a51d53871132af.tar.bz2 |
Add fade in animation for guest session and logged in user session
BUG=154859
Review URL: https://chromiumcodereview.appspot.com/12771012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background/desktop_background_view.cc')
-rw-r--r-- | ash/desktop_background/desktop_background_view.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc index 0675bc9..1ae7378 100644 --- a/ash/desktop_background/desktop_background_view.cc +++ b/ash/desktop_background/desktop_background_view.cc @@ -12,6 +12,7 @@ #include "ash/desktop_background/user_wallpaper_delegate.h" #include "ash/root_window_controller.h" #include "ash/shell.h" +#include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" #include "ash/wm/property_util.h" #include "ash/wm/window_animations.h" @@ -194,17 +195,24 @@ views::Widget* CreateDesktopBackground(aura::RootWindow* root_window, int animation_type = wallpaper_delegate->GetAnimationType(); views::corewm::SetWindowVisibilityAnimationType( desktop_widget->GetNativeView(), animation_type); - // Disable animation when creating the first widget. Otherwise, wallpaper - // will animate from a white screen. Note that boot animation is different. - // It animates from a white background. - if (animation_type == views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE && - root_window->GetProperty(kAnimatingDesktopController) == NULL) { + + // Enable wallpaper transition for the following cases: + // 1. Initial(OOBE) wallpaper animation. + // 2. Wallpaper fades in from a non empty background. + // 3. From an empty background, chrome transit to a logged in user session. + // 4. From an empty background, guest user logged in. + if (wallpaper_delegate->ShouldShowInitialAnimation() || + root_window->GetProperty(kAnimatingDesktopController) || + Shell::GetInstance()->delegate()->IsGuestSession() || + Shell::GetInstance()->delegate()->IsUserLoggedIn()) { views::corewm::SetWindowVisibilityAnimationTransition( - desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); + desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); } else { + // Disable animation if transition to login screen from an empty background. views::corewm::SetWindowVisibilityAnimationTransition( - desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); + desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); } + desktop_widget->SetBounds(params.parent->bounds()); ui::ScopedLayerAnimationSettings settings( desktop_widget->GetNativeView()->layer()->GetAnimator()); |