diff options
author | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-28 23:21:31 +0000 |
---|---|---|
committer | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-28 23:21:31 +0000 |
commit | 5cc1b6590873a23e33a6a14ff8e992f3dba69679 (patch) | |
tree | 879aef806332971dd1349e01ad5d9de6aef1a172 /ash/desktop_background | |
parent | 18fe6adb58e43b891619a7e267ffe4d500f32d80 (diff) | |
download | chromium_src-5cc1b6590873a23e33a6a14ff8e992f3dba69679.zip chromium_src-5cc1b6590873a23e33a6a14ff8e992f3dba69679.tar.gz chromium_src-5cc1b6590873a23e33a6a14ff8e992f3dba69679.tar.bz2 |
Creating multi profile animations for switching users and teleporting of windows.
This CL is adding window animations for the following multi profile related actions:
- switching the user
- teleporting of windows
- window ownership changes
The user switch animation is as follows:
Time: ----->
Screen: A X B
- The desktop cross dissolves between A -> B
- User A's windows fade out between A -> X
- User B's windows get faded in between X -> B
- User A's shelf gets hidden between A -> X
- The user icon in the system tray as well as the shelf configuration changes at 'X'.
- User B's shelf gets faded on between X -> B
So at time X the user would see a half way cross dissolved desktop and shared windows (if there are any).
Since there is no guarantee that there is an animation going from A -> X an additional timer was used to kick off the second animation portion.
Further gotchas:
- Animations of the individual shelf items were in the past incorrectly performed with another animator which produced a lag for some components (e.g. the activation bar lagged and / or there was a gap between icons in the tray and the screen border when playing the animation fast.
- Wallpaper loading was so delayed that the animations started after all other animations were done.
BUG=336639, 307279
Review URL: https://codereview.chromium.org/130983007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background')
-rw-r--r-- | ash/desktop_background/desktop_background_view.cc | 6 | ||||
-rw-r--r-- | ash/desktop_background/user_wallpaper_delegate.h | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc index 6a7bf82..acf4e3b 100644 --- a/ash/desktop_background/desktop_background_view.cc +++ b/ash/desktop_background/desktop_background_view.cc @@ -207,6 +207,12 @@ views::Widget* CreateDesktopBackground(aura::Window* root_window, Shell::GetInstance()->session_state_delegate()->NumberOfLoggedInUsers()) { views::corewm::SetWindowVisibilityAnimationTransition( desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); + int duration_override = wallpaper_delegate->GetAnimationDurationOverride(); + if (duration_override) { + views::corewm::SetWindowVisibilityAnimationDuration( + desktop_widget->GetNativeView(), + base::TimeDelta::FromMilliseconds(duration_override)); + } } else { // Disable animation if transition to login screen from an empty background. views::corewm::SetWindowVisibilityAnimationTransition( diff --git a/ash/desktop_background/user_wallpaper_delegate.h b/ash/desktop_background/user_wallpaper_delegate.h index 440d284..e1e7f70 100644 --- a/ash/desktop_background/user_wallpaper_delegate.h +++ b/ash/desktop_background/user_wallpaper_delegate.h @@ -18,6 +18,13 @@ class ASH_EXPORT UserWallpaperDelegate { // wallpaper. virtual int GetAnimationType() = 0; + // Returns the wallpaper animation duration in ms. A value of 0 indicates + // that the default should be used. + virtual int GetAnimationDurationOverride() = 0; + + // Sets wallpaper animation duration in ms. Pass 0 to use the default. + virtual void SetAnimationDurationOverride(int animation_duration_in_ms) = 0; + // Should the slower initial animation be shown (as opposed to the faster // animation that's used e.g. when switching from one user's wallpaper to // another's on the login screen)? |