| 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/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| 10 #include "ash/common/system/tray/system_tray_notifier.h" | 11 #include "ash/common/system/tray/system_tray_notifier.h" |
| 11 #include "ash/common/wm/window_state.h" | 12 #include "ash/common/wm/window_state.h" |
| 12 #include "ash/common/wm_shell.h" | 13 #include "ash/common/wm_shell.h" |
| 13 #include "ash/multi_profile_uma.h" | 14 #include "ash/multi_profile_uma.h" |
| 14 #include "ash/root_window_controller.h" | 15 #include "ash/root_window_controller.h" |
| 15 #include "ash/shelf/shelf.h" | 16 #include "ash/shelf/shelf.h" |
| 16 #include "ash/shell.h" | 17 #include "ash/shell.h" |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 } | 733 } |
| 733 | 734 |
| 734 void MultiUserWindowManagerChromeOS::SetWindowVisible( | 735 void MultiUserWindowManagerChromeOS::SetWindowVisible( |
| 735 aura::Window* window, | 736 aura::Window* window, |
| 736 bool visible, | 737 bool visible, |
| 737 int animation_time_in_ms) { | 738 int animation_time_in_ms) { |
| 738 // The MaximizeModeWindowManager will not handle invisible windows since they | 739 // The MaximizeModeWindowManager will not handle invisible windows since they |
| 739 // are not user activatable. Since invisible windows are not being tracked, | 740 // are not user activatable. Since invisible windows are not being tracked, |
| 740 // 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 |
| 741 // reduce animation jank from multiple resizes. | 742 // reduce animation jank from multiple resizes. |
| 742 if (visible) | 743 if (visible) { |
| 743 ash::Shell::GetInstance()->maximize_mode_controller()->AddWindow(window); | 744 ash::Shell::GetInstance()->maximize_mode_controller()->AddWindow( |
| 745 ash::WmWindowAura::Get(window)); |
| 746 } |
| 744 | 747 |
| 745 AnimationSetter animation_setter( | 748 AnimationSetter animation_setter( |
| 746 window, | 749 window, |
| 747 GetAdjustedAnimationTimeInMS(animation_time_in_ms)); | 750 GetAdjustedAnimationTimeInMS(animation_time_in_ms)); |
| 748 | 751 |
| 749 if (visible) | 752 if (visible) |
| 750 window->Show(); | 753 window->Show(); |
| 751 else | 754 else |
| 752 window->Hide(); | 755 window->Hide(); |
| 753 } | 756 } |
| 754 | 757 |
| 755 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( | 758 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( |
| 756 int default_time_in_ms) const { | 759 int default_time_in_ms) const { |
| 757 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : | 760 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : |
| 758 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); | 761 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); |
| 759 } | 762 } |
| 760 | 763 |
| 761 } // namespace chrome | 764 } // namespace chrome |
| OLD | NEW |