Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: ash/shell_port.cc

Issue 2919533002: [mus+ash] removes WmWindow, wm_window.h and wm_window.cc (Closed)
Patch Set: [mus+ash] removes WmWindow, wm_window.h and wm_window.cc (fixes build) Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shell_port.h ('k') | ash/wm_transient_window_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/shell_port.h" 5 #include "ash/shell_port.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/accelerators/accelerator_controller.h" 9 #include "ash/accelerators/accelerator_controller.h"
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
11 #include "ash/root_window_controller.h" 11 #include "ash/root_window_controller.h"
12 #include "ash/session/session_controller.h" 12 #include "ash/session/session_controller.h"
13 #include "ash/shelf/app_list_shelf_item_delegate.h" 13 #include "ash/shelf/app_list_shelf_item_delegate.h"
14 #include "ash/shell.h" 14 #include "ash/shell.h"
15 #include "ash/shell_delegate.h" 15 #include "ash/shell_delegate.h"
16 #include "ash/wm/root_window_finder.h" 16 #include "ash/wm/root_window_finder.h"
17 #include "ash/wm/system_modal_container_layout_manager.h" 17 #include "ash/wm/system_modal_container_layout_manager.h"
18 #include "ash/wm_window.h"
19 #include "base/bind.h" 18 #include "base/bind.h"
20 #include "base/logging.h" 19 #include "base/logging.h"
21 #include "base/memory/ptr_util.h" 20 #include "base/memory/ptr_util.h"
21 #include "ui/aura/client/aura_constants.h"
22 #include "ui/aura/window.h"
22 #include "ui/display/display.h" 23 #include "ui/display/display.h"
23 24
24 namespace ash { 25 namespace ash {
25 26
26 // static 27 // static
27 ShellPort* ShellPort::instance_ = nullptr; 28 ShellPort* ShellPort::instance_ = nullptr;
28 29
29 ShellPort::~ShellPort() { 30 ShellPort::~ShellPort() {
30 DCHECK_EQ(this, instance_); 31 DCHECK_EQ(this, instance_);
31 instance_ = nullptr; 32 instance_ = nullptr;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 bool ShellPort::IsForceMaximizeOnFirstRun() { 73 bool ShellPort::IsForceMaximizeOnFirstRun() {
73 return Shell::Get()->shell_delegate()->IsForceMaximizeOnFirstRun(); 74 return Shell::Get()->shell_delegate()->IsForceMaximizeOnFirstRun();
74 } 75 }
75 76
76 bool ShellPort::IsSystemModalWindowOpen() { 77 bool ShellPort::IsSystemModalWindowOpen() {
77 if (simulate_modal_window_open_for_testing_) 78 if (simulate_modal_window_open_for_testing_)
78 return true; 79 return true;
79 80
80 // Traverse all system modal containers, and find its direct child window 81 // Traverse all system modal containers, and find its direct child window
81 // with "SystemModal" setting, and visible. 82 // with "SystemModal" setting, and visible.
82 for (WmWindow* root : GetAllRootWindows()) { 83 for (aura::Window* root : GetAllRootWindows()) {
83 WmWindow* system_modal = 84 aura::Window* system_modal =
84 root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer); 85 root->GetChildById(kShellWindowId_SystemModalContainer);
85 if (!system_modal) 86 if (!system_modal)
86 continue; 87 continue;
87 for (const WmWindow* child : system_modal->GetChildren()) { 88 for (const aura::Window* child : system_modal->children()) {
88 if (child->IsSystemModal() && child->GetTargetVisibility()) { 89 if (child->GetProperty(aura::client::kModalKey) ==
90 ui::MODAL_TYPE_SYSTEM &&
91 child->layer()->GetTargetVisibility()) {
89 return true; 92 return true;
90 } 93 }
91 } 94 }
92 } 95 }
93 return false; 96 return false;
94 } 97 }
95 98
96 void ShellPort::CreateModalBackground(aura::Window* window) { 99 void ShellPort::CreateModalBackground(aura::Window* window) {
97 for (aura::Window* root_window : Shell::GetAllRootWindows()) { 100 for (aura::Window* root_window : Shell::GetAllRootWindows()) {
98 RootWindowController::ForWindow(root_window) 101 RootWindowController::ForWindow(root_window)
(...skipping 12 matching lines...) Expand all
111 } 114 }
112 } 115 }
113 for (aura::Window* root_window : root_windows) { 116 for (aura::Window* root_window : root_windows) {
114 RootWindowController::ForWindow(root_window) 117 RootWindowController::ForWindow(root_window)
115 ->GetSystemModalLayoutManager(removed) 118 ->GetSystemModalLayoutManager(removed)
116 ->DestroyModalBackground(); 119 ->DestroyModalBackground();
117 } 120 }
118 } 121 }
119 122
120 } // namespace ash 123 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_port.h ('k') | ash/wm_transient_window_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698