| 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/window_dimmer.h" |
| 12 #include "ash/common/wm/window_state.h" | 13 #include "ash/common/wm/window_state.h" |
| 13 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 14 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 15 #include "ash/common/wm_window_observer.h" | 16 #include "ash/common/wm_window_observer.h" |
| 16 #include "ash/display/window_tree_host_manager.h" | 17 #include "ash/display/window_tree_host_manager.h" |
| 17 #include "ash/shell.h" | 18 #include "ash/shell.h" |
| 18 #include "ash/wm/dim_window.h" | |
| 19 #include "base/auto_reset.h" | 19 #include "base/auto_reset.h" |
| 20 #include "base/logging.h" | 20 #include "base/logging.h" |
| 21 #include "base/stl_util.h" | 21 #include "base/stl_util.h" |
| 22 #include "ui/aura/window_observer.h" | 22 #include "ui/aura/window_observer.h" |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 WmWindow* CreateDimWindow(WmWindow* container) { | 27 WmWindow* CreateDimWindow(WmWindow* container) { |
| 28 DimWindow* dim_window = new DimWindow(WmWindowAura::GetAuraWindow(container)); | 28 // WindowDimmer is owned by |container|. |
| 29 dim_window->SetDimOpacity(1); // Set whole black. | 29 WindowDimmer* window_dimmer = new WindowDimmer(container); |
| 30 WmWindow* result = WmWindowAura::Get(dim_window); | 30 window_dimmer->SetDimOpacity(1); // Fully opaque. |
| 31 result->SetFullscreen(); | 31 window_dimmer->window()->SetFullscreen(); |
| 32 result->Show(); | 32 window_dimmer->window()->Show(); |
| 33 return result; | 33 return window_dimmer->window(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 // Returns a list of WmWindows corresponding to SystemModalContainers, | 36 // Returns a list of WmWindows corresponding to SystemModalContainers, |
| 37 // except ones whose root is shared with |pinned_window|. | 37 // except ones whose root is shared with |pinned_window|. |
| 38 std::vector<WmWindow*> GetSystemModalWindowsExceptPinned( | 38 std::vector<WmWindow*> GetSystemModalWindowsExceptPinned( |
| 39 WmWindow* pinned_window) { | 39 WmWindow* pinned_window) { |
| 40 WmWindow* pinned_root = pinned_window->GetRootWindow(); | 40 WmWindow* pinned_root = pinned_window->GetRootWindow(); |
| 41 | 41 |
| 42 std::vector<WmWindow*> result; | 42 std::vector<WmWindow*> result; |
| 43 for (WmWindow* system_modal : | 43 for (WmWindow* system_modal : |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 base::AutoReset<bool> auto_reset(&in_restacking_, true); | 392 base::AutoReset<bool> auto_reset(&in_restacking_, true); |
| 393 for (WmWindow* dim_window : dim_windows_) { | 393 for (WmWindow* dim_window : dim_windows_) { |
| 394 if (dim_window->GetParent() == container) { | 394 if (dim_window->GetParent() == container) { |
| 395 container->StackChildAtBottom(dim_window); | 395 container->StackChildAtBottom(dim_window); |
| 396 break; | 396 break; |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // namespace ash | 401 } // namespace ash |
| OLD | NEW |