OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <queue> | 8 #include <queue> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 if (iter == src_container_children.end()) | 246 if (iter == src_container_children.end()) |
247 break; | 247 break; |
248 ReparentWindow(*iter, dst_container); | 248 ReparentWindow(*iter, dst_container); |
249 } | 249 } |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 // Creates a new window for use as a container. | 253 // Creates a new window for use as a container. |
254 // TODO(sky): This should create an aura::Window. http://crbug.com/671246. | 254 // TODO(sky): This should create an aura::Window. http://crbug.com/671246. |
255 WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) { | 255 WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) { |
256 WmWindow* window = WmShell::Get()->NewWindow(ui::wm::WINDOW_TYPE_UNKNOWN, | 256 aura::Window* window = new aura::Window(nullptr, ui::wm::WINDOW_TYPE_UNKNOWN); |
257 ui::LAYER_NOT_DRAWN); | 257 window->Init(ui::LAYER_NOT_DRAWN); |
258 if (WmShell::Get()->IsRunningInMash()) { | 258 if (WmShell::Get()->IsRunningInMash()) { |
259 aura::WindowPortMus::Get(window->aura_window()) | 259 aura::WindowPortMus::Get(window)->SetEventTargetingPolicy( |
260 ->SetEventTargetingPolicy( | 260 ui::mojom::EventTargetingPolicy::DESCENDANTS_ONLY); |
261 ui::mojom::EventTargetingPolicy::DESCENDANTS_ONLY); | |
262 } | 261 } |
263 window->SetShellWindowId(window_id); | 262 window->set_id(window_id); |
264 window->SetName(name); | 263 window->SetName(name); |
265 parent->AddChild(window); | 264 parent->aura_window()->AddChild(window); |
266 if (window_id != kShellWindowId_UnparentedControlContainer) | 265 if (window_id != kShellWindowId_UnparentedControlContainer) |
267 window->Show(); | 266 window->Show(); |
268 return window; | 267 return WmWindow::Get(window); |
269 } | 268 } |
270 | 269 |
271 // TODO(sky): This should take an aura::Window. http://crbug.com/671246. | 270 // TODO(sky): This should take an aura::Window. http://crbug.com/671246. |
272 bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) { | 271 bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) { |
273 if (!WmWindow::GetAuraWindow(window)->owned_by_parent()) | 272 if (!WmWindow::GetAuraWindow(window)->owned_by_parent()) |
274 return false; | 273 return false; |
275 | 274 |
276 if (!WmShell::Get()->IsRunningInMash()) | 275 if (!WmShell::Get()->IsRunningInMash()) |
277 return true; | 276 return true; |
278 | 277 |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 EnableTouchHudProjection(); | 1153 EnableTouchHudProjection(); |
1155 else | 1154 else |
1156 DisableTouchHudProjection(); | 1155 DisableTouchHudProjection(); |
1157 } | 1156 } |
1158 | 1157 |
1159 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1158 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
1160 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1159 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
1161 } | 1160 } |
1162 | 1161 |
1163 } // namespace ash | 1162 } // namespace ash |
OLD | NEW |