| Index: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
|
| diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
|
| index 6e6548a457431cbff561c4edff99a145e68a6bb6..a8a26cf05e29ad7936efcfcdf82db7f27a6c013a 100644
|
| --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
|
| +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
|
| @@ -48,6 +48,10 @@ namespace {
|
| // in / out.
|
| const int kAnimationTimeMS = 100;
|
|
|
| +// The animation time in milliseconds for the fade in and / or out when
|
| +// switching users.
|
| +const int kUserFadeTimeMS = 110;
|
| +
|
| // The animation time in ms for a window which get teleported to another screen.
|
| const int kTeleportAnimationTimeMS = 300;
|
|
|
| @@ -208,7 +212,7 @@ MultiUserWindowManagerChromeOS::MultiUserWindowManagerChromeOS(
|
| notification_blocker_(new MultiUserNotificationBlockerChromeOS(
|
| message_center::MessageCenter::Get(), this, current_user_id)),
|
| suppress_visibility_changes_(false),
|
| - animations_disabled_(false) {
|
| + animation_speed_(ANIMATION_SPEED_NORMAL) {
|
| // Add a session state observer to be able to monitor session changes.
|
| if (ash::Shell::HasInstance())
|
| ash::Shell::GetInstance()->session_state_delegate()->
|
| @@ -393,7 +397,8 @@ void MultiUserWindowManagerChromeOS::ActiveUserChanged(
|
| current_user_id_ = user_id;
|
|
|
| animation_.reset(
|
| - new UserSwichAnimatorChromeOS(this, user_id, animations_disabled_));
|
| + new UserSwichAnimatorChromeOS(
|
| + this, user_id, GetAdjustedAnimationTimeInMS(kUserFadeTimeMS)));
|
| }
|
|
|
| void MultiUserWindowManagerChromeOS::OnWindowDestroyed(aura::Window* window) {
|
| @@ -485,8 +490,9 @@ void MultiUserWindowManagerChromeOS::Observe(
|
| AddBrowserWindow(content::Source<Browser>(source).ptr());
|
| }
|
|
|
| -void MultiUserWindowManagerChromeOS::SetAnimationsForTest(bool disable) {
|
| - animations_disabled_ = disable;
|
| +void MultiUserWindowManagerChromeOS::SetAnimationSpeedForTest(
|
| + MultiUserWindowManagerChromeOS::AnimationSpeed speed) {
|
| + animation_speed_ = speed;
|
| }
|
|
|
| bool MultiUserWindowManagerChromeOS::IsAnimationRunningForTest() {
|
| @@ -682,7 +688,7 @@ void MultiUserWindowManagerChromeOS::SetWindowVisible(
|
| int animation_time_in_ms) {
|
| AnimationSetter animation_setter(
|
| window,
|
| - animations_disabled_ ? 0 : animation_time_in_ms);
|
| + GetAdjustedAnimationTimeInMS(animation_time_in_ms));
|
|
|
| if (visible)
|
| window->Show();
|
| @@ -694,4 +700,10 @@ void MultiUserWindowManagerChromeOS::SetWindowVisible(
|
| DCHECK_EQ(visible, window->IsVisible());
|
| }
|
|
|
| +int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS(
|
| + int default_time_in_ms) {
|
| + return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms :
|
| + (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0);
|
| +}
|
| +
|
| } // namespace chrome
|
|
|