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" |
11 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 11 #include "ash/wm/tablet_mode/tablet_mode_controller.h" |
12 #include "ash/wm/window_state.h" | 12 #include "ash/wm/window_state.h" |
13 #include "ash/wm_window.h" | 13 #include "ash/wm_window.h" |
14 #include "base/auto_reset.h" | 14 #include "base/auto_reset.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 // dependents have been shown previously already. | 676 // dependents have been shown previously already. |
677 base::AutoReset<bool> suppressor(&suppress_visibility_changes_, true); | 677 base::AutoReset<bool> suppressor(&suppress_visibility_changes_, true); |
678 window->Show(); | 678 window->Show(); |
679 } | 679 } |
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 TabletModeWindowManager 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(window); | 691 ash::Shell::Get()->tablet_mode_controller()->AddWindow(window); |
692 | 692 |
693 AnimationSetter animation_setter( | 693 AnimationSetter animation_setter( |
694 window, | 694 window, |
695 GetAdjustedAnimationTimeInMS(animation_time_in_ms)); | 695 GetAdjustedAnimationTimeInMS(animation_time_in_ms)); |
696 | 696 |
697 if (visible) | 697 if (visible) |
698 window->Show(); | 698 window->Show(); |
699 else | 699 else |
700 window->Hide(); | 700 window->Hide(); |
701 } | 701 } |
702 | 702 |
703 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( | 703 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( |
704 int default_time_in_ms) const { | 704 int default_time_in_ms) const { |
705 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : | 705 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : |
706 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); | 706 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); |
707 } | 707 } |
708 | 708 |
709 } // namespace chrome | 709 } // namespace chrome |
OLD | NEW |