| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" | 5 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 | 734 |
| 735 void MultiUserWindowManagerChromeOS::SetWindowVisible( | 735 void MultiUserWindowManagerChromeOS::SetWindowVisible( |
| 736 aura::Window* window, | 736 aura::Window* window, |
| 737 bool visible, | 737 bool visible, |
| 738 int animation_time_in_ms) { | 738 int animation_time_in_ms) { |
| 739 // The MaximizeModeWindowManager will not handle invisible windows since they | 739 // The MaximizeModeWindowManager will not handle invisible windows since they |
| 740 // are not user activatable. Since invisible windows are not being tracked, | 740 // are not user activatable. Since invisible windows are not being tracked, |
| 741 // we tell it to maximize / track this window now before it gets shown, to | 741 // we tell it to maximize / track this window now before it gets shown, to |
| 742 // reduce animation jank from multiple resizes. | 742 // reduce animation jank from multiple resizes. |
| 743 if (visible) { | 743 if (visible) { |
| 744 ash::Shell::GetInstance()->maximize_mode_controller()->AddWindow( | 744 ash::WmShell::Get()->maximize_mode_controller()->AddWindow( |
| 745 ash::WmWindowAura::Get(window)); | 745 ash::WmWindowAura::Get(window)); |
| 746 } | 746 } |
| 747 | 747 |
| 748 AnimationSetter animation_setter( | 748 AnimationSetter animation_setter( |
| 749 window, | 749 window, |
| 750 GetAdjustedAnimationTimeInMS(animation_time_in_ms)); | 750 GetAdjustedAnimationTimeInMS(animation_time_in_ms)); |
| 751 | 751 |
| 752 if (visible) | 752 if (visible) |
| 753 window->Show(); | 753 window->Show(); |
| 754 else | 754 else |
| 755 window->Hide(); | 755 window->Hide(); |
| 756 } | 756 } |
| 757 | 757 |
| 758 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( | 758 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( |
| 759 int default_time_in_ms) const { | 759 int default_time_in_ms) const { |
| 760 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : | 760 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : |
| 761 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); | 761 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); |
| 762 } | 762 } |
| 763 | 763 |
| 764 } // namespace chrome | 764 } // namespace chrome |
| OLD | NEW |