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/mus/disconnected_app_handler.h" | 5 #include "ash/mus/disconnected_app_handler.h" |
6 | 6 |
7 #include "ash/mus/bridge/wm_window_mus.h" | 7 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 namespace mus { | 12 namespace mus { |
13 namespace { | 13 namespace { |
14 | 14 |
15 bool IsContainer(aura::Window* window) { | 15 bool IsContainer(aura::Window* window) { |
16 return WmWindowMus::Get(window)->IsContainer(); | 16 return WmWindowAura::Get(window)->GetShellWindowId() != |
| 17 kShellWindowId_Invalid; |
17 } | 18 } |
18 | 19 |
19 } // namespace | 20 } // namespace |
20 | 21 |
21 DisconnectedAppHandler::DisconnectedAppHandler(aura::Window* root_window) { | 22 DisconnectedAppHandler::DisconnectedAppHandler(aura::Window* root_window) { |
22 WmWindowMus* root = WmWindowMus::Get(root_window); | 23 ash::WmWindowAura* root = ash::WmWindowAura::Get(root_window); |
23 for (int shell_window_id = kShellWindowId_Min; | 24 for (int shell_window_id = kShellWindowId_Min; |
24 shell_window_id < kShellWindowId_Max; ++shell_window_id) { | 25 shell_window_id < kShellWindowId_Max; ++shell_window_id) { |
25 // kShellWindowId_VirtualKeyboardContainer is lazily created. | 26 // kShellWindowId_VirtualKeyboardContainer is lazily created. |
26 // TODO(sky): http://crbug.com/616909 . | 27 // TODO(sky): http://crbug.com/616909 . |
27 // kShellWindowId_PhantomWindow is not a container, but a window. | 28 // kShellWindowId_PhantomWindow is not a container, but a window. |
28 if (shell_window_id == kShellWindowId_VirtualKeyboardContainer || | 29 if (shell_window_id == kShellWindowId_VirtualKeyboardContainer || |
29 shell_window_id == kShellWindowId_PhantomWindow) | 30 shell_window_id == kShellWindowId_PhantomWindow) |
30 continue; | 31 continue; |
31 | 32 |
32 // kShellWindowId_MouseCursorContainer is chromeos specific. | 33 // kShellWindowId_MouseCursorContainer is chromeos specific. |
33 #if !defined(OS_CHROMEOS) | 34 #if !defined(OS_CHROMEOS) |
34 if (shell_window_id == kShellWindowId_MouseCursorContainer) | 35 if (shell_window_id == kShellWindowId_MouseCursorContainer) |
35 continue; | 36 continue; |
36 #endif | 37 #endif |
37 | 38 |
38 WmWindowMus* container = WmWindowMus::AsWmWindowMus( | 39 ash::WmWindowAura* container = static_cast<ash::WmWindowAura*>( |
39 root->GetChildByShellWindowId(shell_window_id)); | 40 root->GetChildByShellWindowId(shell_window_id)); |
40 Add(container->aura_window()); | 41 Add(container->aura_window()); |
41 | 42 |
42 // Add any pre-existing windows in the container to | 43 // Add any pre-existing windows in the container to |
43 // |disconnected_app_handler_|. | 44 // |disconnected_app_handler_|. |
44 for (aura::Window* child : container->aura_window()->children()) { | 45 for (aura::Window* child : container->aura_window()->children()) { |
45 if (!IsContainer(child)) | 46 if (!IsContainer(child)) |
46 Add(child); | 47 Add(child); |
47 } | 48 } |
48 } | 49 } |
(...skipping 12 matching lines...) Expand all Loading... |
61 Remove(params.target); | 62 Remove(params.target); |
62 | 63 |
63 if (params.new_parent == params.receiver && IsContainer(params.new_parent)) | 64 if (params.new_parent == params.receiver && IsContainer(params.new_parent)) |
64 Add(params.target); | 65 Add(params.target); |
65 | 66 |
66 aura::WindowTracker::OnWindowHierarchyChanging(params); | 67 aura::WindowTracker::OnWindowHierarchyChanging(params); |
67 } | 68 } |
68 | 69 |
69 } // namespace mus | 70 } // namespace mus |
70 } // namespace ash | 71 } // namespace ash |
OLD | NEW |