| 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 "apps/app_window.h" | 7 #include "apps/app_window.h" |
| 8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/desktop_background/user_wallpaper_delegate.h" | 10 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 return; | 729 return; |
| 730 | 730 |
| 731 // Hiding a system modal dialog should not be allowed. Instead we switch to | 731 // Hiding a system modal dialog should not be allowed. Instead we switch to |
| 732 // the user which is showing the system modal window. | 732 // the user which is showing the system modal window. |
| 733 // Note that in some cases (e.g. unit test) windows might not have a root | 733 // Note that in some cases (e.g. unit test) windows might not have a root |
| 734 // window. | 734 // window. |
| 735 if (!visible && window->GetRootWindow()) { | 735 if (!visible && window->GetRootWindow()) { |
| 736 // Get the system modal container for the window's root window. | 736 // Get the system modal container for the window's root window. |
| 737 aura::Window* system_modal_container = | 737 aura::Window* system_modal_container = |
| 738 window->GetRootWindow()->GetChildById( | 738 window->GetRootWindow()->GetChildById( |
| 739 ash::internal::kShellWindowId_SystemModalContainer); | 739 ash::kShellWindowId_SystemModalContainer); |
| 740 if (window->parent() == system_modal_container) { | 740 if (window->parent() == system_modal_container) { |
| 741 // The window is system modal and we need to find the parent which owns | 741 // The window is system modal and we need to find the parent which owns |
| 742 // it so that we can switch to the desktop accordingly. | 742 // it so that we can switch to the desktop accordingly. |
| 743 std::string user_id = GetUserPresentingWindow(window); | 743 std::string user_id = GetUserPresentingWindow(window); |
| 744 if (user_id.empty()) { | 744 if (user_id.empty()) { |
| 745 aura::Window* owning_window = GetOwningWindowInTransientChain(window); | 745 aura::Window* owning_window = GetOwningWindowInTransientChain(window); |
| 746 DCHECK(owning_window); | 746 DCHECK(owning_window); |
| 747 user_id = GetUserPresentingWindow(owning_window); | 747 user_id = GetUserPresentingWindow(owning_window); |
| 748 DCHECK(!user_id.empty()); | 748 DCHECK(!user_id.empty()); |
| 749 } | 749 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 window->Show(); | 863 window->Show(); |
| 864 else | 864 else |
| 865 window->Hide(); | 865 window->Hide(); |
| 866 | 866 |
| 867 // Make sure that animations have no influence on the window state after the | 867 // Make sure that animations have no influence on the window state after the |
| 868 // call. | 868 // call. |
| 869 DCHECK_EQ(visible, window->IsVisible()); | 869 DCHECK_EQ(visible, window->IsVisible()); |
| 870 } | 870 } |
| 871 | 871 |
| 872 } // namespace chrome | 872 } // namespace chrome |
| OLD | NEW |