| 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/media_controller.h" | 7 #include "ash/media_controller.h" |
| 8 #include "ash/multi_profile_uma.h" | 8 #include "ash/multi_profile_uma.h" |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 } | 680 } |
| 681 | 681 |
| 682 void MultiUserWindowManagerChromeOS::SetWindowVisible( | 682 void MultiUserWindowManagerChromeOS::SetWindowVisible( |
| 683 aura::Window* window, | 683 aura::Window* window, |
| 684 bool visible, | 684 bool visible, |
| 685 int animation_time_in_ms) { | 685 int animation_time_in_ms) { |
| 686 // The MaximizeModeWindowManager will not handle invisible windows since they | 686 // The MaximizeModeWindowManager will not handle invisible windows since they |
| 687 // are not user activatable. Since invisible windows are not being tracked, | 687 // are not user activatable. Since invisible windows are not being tracked, |
| 688 // we tell it to maximize / track this window now before it gets shown, to | 688 // we tell it to maximize / track this window now before it gets shown, to |
| 689 // reduce animation jank from multiple resizes. | 689 // reduce animation jank from multiple resizes. |
| 690 if (visible) { | 690 if (visible) |
| 691 ash::Shell::Get()->maximize_mode_controller()->AddWindow( | 691 ash::Shell::Get()->maximize_mode_controller()->AddWindow(window); |
| 692 ash::WmWindow::Get(window)); | |
| 693 } | |
| 694 | 692 |
| 695 AnimationSetter animation_setter( | 693 AnimationSetter animation_setter( |
| 696 window, | 694 window, |
| 697 GetAdjustedAnimationTimeInMS(animation_time_in_ms)); | 695 GetAdjustedAnimationTimeInMS(animation_time_in_ms)); |
| 698 | 696 |
| 699 if (visible) | 697 if (visible) |
| 700 window->Show(); | 698 window->Show(); |
| 701 else | 699 else |
| 702 window->Hide(); | 700 window->Hide(); |
| 703 } | 701 } |
| 704 | 702 |
| 705 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( | 703 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( |
| 706 int default_time_in_ms) const { | 704 int default_time_in_ms) const { |
| 707 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : | 705 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : |
| 708 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); | 706 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); |
| 709 } | 707 } |
| 710 | 708 |
| 711 } // namespace chrome | 709 } // namespace chrome |
| OLD | NEW |