| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/wm/screen_pinning_controller.h" | 5 #include "ash/wm/screen_pinning_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/aura/wm_window_aura.h" | 10 #include "ash/aura/wm_window_aura.h" |
| 11 #include "ash/common/shell_window_ids.h" | 11 #include "ash/common/shell_window_ids.h" |
| 12 #include "ash/common/wm/container_finder.h" |
| 12 #include "ash/common/wm/window_dimmer.h" | 13 #include "ash/common/wm/window_dimmer.h" |
| 13 #include "ash/common/wm/window_state.h" | 14 #include "ash/common/wm/window_state.h" |
| 14 #include "ash/common/wm_shell.h" | 15 #include "ash/common/wm_shell.h" |
| 15 #include "ash/common/wm_window.h" | 16 #include "ash/common/wm_window.h" |
| 16 #include "ash/common/wm_window_observer.h" | 17 #include "ash/common/wm_window_observer.h" |
| 17 #include "ash/common/wm_window_user_data.h" | 18 #include "ash/common/wm_window_user_data.h" |
| 18 #include "ash/display/window_tree_host_manager.h" | 19 #include "ash/display/window_tree_host_manager.h" |
| 19 #include "ash/shell.h" | |
| 20 #include "base/auto_reset.h" | 20 #include "base/auto_reset.h" |
| 21 #include "base/logging.h" | 21 #include "base/logging.h" |
| 22 #include "base/memory/ptr_util.h" | 22 #include "base/memory/ptr_util.h" |
| 23 #include "ui/aura/window_observer.h" | 23 #include "ui/aura/window_observer.h" |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 // Returns a list of WmWindows corresponding to SystemModalContainers, | 28 // Returns a list of WmWindows corresponding to SystemModalContainers, |
| 29 // except ones whose root is shared with |pinned_window|. | 29 // except ones whose root is shared with |pinned_window|. |
| 30 std::vector<WmWindow*> GetSystemModalWindowsExceptPinned( | 30 std::vector<WmWindow*> GetSystemModalWindowsExceptPinned( |
| 31 WmWindow* pinned_window) { | 31 WmWindow* pinned_window) { |
| 32 WmWindow* pinned_root = pinned_window->GetRootWindow(); | 32 WmWindow* pinned_root = pinned_window->GetRootWindow(); |
| 33 | 33 |
| 34 std::vector<WmWindow*> result; | 34 std::vector<WmWindow*> result; |
| 35 for (WmWindow* system_modal : | 35 for (WmWindow* system_modal : wm::GetContainersFromAllRootWindows( |
| 36 WmWindowAura::FromAuraWindows(Shell::GetContainersFromAllRootWindows( | 36 kShellWindowId_SystemModalContainer)) { |
| 37 kShellWindowId_SystemModalContainer, nullptr))) { | |
| 38 if (system_modal->GetRootWindow() == pinned_root) | 37 if (system_modal->GetRootWindow() == pinned_root) |
| 39 continue; | 38 continue; |
| 40 result.push_back(system_modal); | 39 result.push_back(system_modal); |
| 41 } | 40 } |
| 42 return result; | 41 return result; |
| 43 } | 42 } |
| 44 | 43 |
| 45 void AddObserverToChildren(WmWindow* container, | 44 void AddObserverToChildren(WmWindow* container, |
| 46 aura::WindowObserver* observer) { | 45 aura::WindowObserver* observer) { |
| 47 for (WmWindow* child : container->GetChildren()) { | 46 for (WmWindow* child : container->GetChildren()) { |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 return; | 341 return; |
| 343 | 342 |
| 344 WindowDimmer* window_dimmer = window_dimmers_->Get(container); | 343 WindowDimmer* window_dimmer = window_dimmers_->Get(container); |
| 345 if (window_dimmer) { | 344 if (window_dimmer) { |
| 346 base::AutoReset<bool> auto_reset(&in_restacking_, true); | 345 base::AutoReset<bool> auto_reset(&in_restacking_, true); |
| 347 container->StackChildAtBottom(window_dimmer->window()); | 346 container->StackChildAtBottom(window_dimmer->window()); |
| 348 } | 347 } |
| 349 } | 348 } |
| 350 | 349 |
| 351 } // namespace ash | 350 } // namespace ash |
| OLD | NEW |