Chromium Code Reviews| 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..6698ffd05d5708189643236136f60866ceede4ec 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,9 @@ void MultiUserWindowManagerChromeOS::ActiveUserChanged( |
| current_user_id_ = user_id; |
| animation_.reset( |
| - new UserSwichAnimatorChromeOS(this, user_id, animations_disabled_)); |
| + new UserSwichAnimatorChromeOS(this, user_id, |
| + animation_speed_ == ANIMATION_SPEED_NORMAL ? kUserFadeTimeMS : |
| + (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0))); |
| } |
| void MultiUserWindowManagerChromeOS::OnWindowDestroyed(aura::Window* window) { |
| @@ -485,8 +491,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 +689,8 @@ void MultiUserWindowManagerChromeOS::SetWindowVisible( |
| int animation_time_in_ms) { |
| AnimationSetter animation_setter( |
| window, |
| - animations_disabled_ ? 0 : animation_time_in_ms); |
| + animation_speed_ == ANIMATION_SPEED_NORMAL ? animation_time_in_ms : |
| + (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0)); |
|
Dmitry Polukhin
2014/04/10 00:11:48
I would extract it to separate method that gets no
Mr4D (OOO till 08-26)
2014/04/10 17:10:17
Done.
|
| if (visible) |
| window->Show(); |