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 | |
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')
-rw-r--r-- | ash/desktop_background/desktop_background_view.cc | 22 | ||||
-rw-r--r-- | ash/shell/shell_delegate_impl.cc | 4 | ||||
-rw-r--r-- | ash/shell/shell_delegate_impl.h | 1 | ||||
-rw-r--r-- | ash/shell_delegate.h | 3 | ||||
-rw-r--r-- | ash/test/test_shell_delegate.cc | 4 | ||||
-rw-r--r-- | ash/test/test_shell_delegate.h | 1 |
6 files changed, 28 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()); diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc index 6b57e1e..c67fda4 100644 --- a/ash/shell/shell_delegate_impl.cc +++ b/ash/shell/shell_delegate_impl.cc @@ -47,6 +47,10 @@ bool ShellDelegateImpl::IsSessionStarted() const { return true; } +bool ShellDelegateImpl::IsGuestSession() const { + return false; +} + bool ShellDelegateImpl::IsFirstRunAfterBoot() const { return false; } diff --git a/ash/shell/shell_delegate_impl.h b/ash/shell/shell_delegate_impl.h index 9ac2f78..505689d 100644 --- a/ash/shell/shell_delegate_impl.h +++ b/ash/shell/shell_delegate_impl.h @@ -25,6 +25,7 @@ class ShellDelegateImpl : public ash::ShellDelegate { virtual bool IsUserLoggedIn() const OVERRIDE; virtual bool IsSessionStarted() const OVERRIDE; + virtual bool IsGuestSession() const OVERRIDE; virtual bool IsFirstRunAfterBoot() const OVERRIDE; virtual bool IsRunningInForcedAppMode() const OVERRIDE; virtual bool CanLockScreen() const OVERRIDE; diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h index a5a2744..bb3c6dd 100644 --- a/ash/shell_delegate.h +++ b/ash/shell_delegate.h @@ -92,6 +92,9 @@ class ASH_EXPORT ShellDelegate { // Returns true if we're logged in and browser has been started virtual bool IsSessionStarted() const = 0; + // Returns true if we're logged in as guest. + virtual bool IsGuestSession() const = 0; + // Returns true if this is the first time that the shell has been run after // the system has booted. false is returned after the shell has been // restarted, typically due to logging in as a guest or logging out. diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index 63af2e5..ade9690 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -41,6 +41,10 @@ bool TestShellDelegate::IsSessionStarted() const { return session_started_; } +bool TestShellDelegate::IsGuestSession() const { + return false; +} + bool TestShellDelegate::IsFirstRunAfterBoot() const { return false; } diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h index 862d6ae..7865b72 100644 --- a/ash/test/test_shell_delegate.h +++ b/ash/test/test_shell_delegate.h @@ -24,6 +24,7 @@ class TestShellDelegate : public ShellDelegate { // Overridden from ShellDelegate: virtual bool IsUserLoggedIn() const OVERRIDE; virtual bool IsSessionStarted() const OVERRIDE; + virtual bool IsGuestSession() const OVERRIDE; virtual bool IsFirstRunAfterBoot() const OVERRIDE; virtual bool IsRunningInForcedAppMode() const OVERRIDE; virtual bool CanLockScreen() const OVERRIDE; |