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

Side by Side Diff: ash/mus/disconnected_app_handler.cc

Issue 2182633011: Replaces ::ui:: with ui:: in ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/mus/disconnected_app_handler.h ('k') | ash/mus/frame/move_event_handler.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/mus/disconnected_app_handler.h" 5 #include "ash/mus/disconnected_app_handler.h"
6 6
7 #include "ash/common/shell_window_ids.h" 7 #include "ash/common/shell_window_ids.h"
8 #include "ash/mus/bridge/wm_window_mus.h" 8 #include "ash/mus/bridge/wm_window_mus.h"
9 9
10 namespace ash { 10 namespace ash {
11 namespace mus { 11 namespace mus {
12 namespace { 12 namespace {
13 13
14 bool IsContainer(::ui::Window* window) { 14 bool IsContainer(ui::Window* window) {
15 return WmWindowMus::Get(window)->IsContainer(); 15 return WmWindowMus::Get(window)->IsContainer();
16 } 16 }
17 17
18 } // namespace 18 } // namespace
19 19
20 DisconnectedAppHandler::DisconnectedAppHandler(::ui::Window* root_window) { 20 DisconnectedAppHandler::DisconnectedAppHandler(ui::Window* root_window) {
21 WmWindowMus* root = WmWindowMus::Get(root_window); 21 WmWindowMus* root = WmWindowMus::Get(root_window);
22 for (int shell_window_id = kShellWindowId_Min; 22 for (int shell_window_id = kShellWindowId_Min;
23 shell_window_id < kShellWindowId_Max; ++shell_window_id) { 23 shell_window_id < kShellWindowId_Max; ++shell_window_id) {
24 // kShellWindowId_VirtualKeyboardContainer is lazily created. 24 // kShellWindowId_VirtualKeyboardContainer is lazily created.
25 // TODO(sky): http://crbug.com/616909 . 25 // TODO(sky): http://crbug.com/616909 .
26 // kShellWindowId_PhantomWindow is not a container, but a window. 26 // kShellWindowId_PhantomWindow is not a container, but a window.
27 if (shell_window_id == kShellWindowId_VirtualKeyboardContainer || 27 if (shell_window_id == kShellWindowId_VirtualKeyboardContainer ||
28 shell_window_id == kShellWindowId_PhantomWindow) 28 shell_window_id == kShellWindowId_PhantomWindow)
29 continue; 29 continue;
30 30
31 // kShellWindowId_MouseCursorContainer is chromeos specific. 31 // kShellWindowId_MouseCursorContainer is chromeos specific.
32 #if !defined(OS_CHROMEOS) 32 #if !defined(OS_CHROMEOS)
33 if (shell_window_id == kShellWindowId_MouseCursorContainer) 33 if (shell_window_id == kShellWindowId_MouseCursorContainer)
34 continue; 34 continue;
35 #endif 35 #endif
36 36
37 WmWindowMus* container = WmWindowMus::AsWmWindowMus( 37 WmWindowMus* container = WmWindowMus::AsWmWindowMus(
38 root->GetChildByShellWindowId(shell_window_id)); 38 root->GetChildByShellWindowId(shell_window_id));
39 Add(container->mus_window()); 39 Add(container->mus_window());
40 40
41 // Add any pre-existing windows in the container to 41 // Add any pre-existing windows in the container to
42 // |disconnected_app_handler_|. 42 // |disconnected_app_handler_|.
43 for (::ui::Window* child : container->mus_window()->children()) { 43 for (ui::Window* child : container->mus_window()->children()) {
44 if (!IsContainer(child)) 44 if (!IsContainer(child))
45 Add(child); 45 Add(child);
46 } 46 }
47 } 47 }
48 } 48 }
49 49
50 DisconnectedAppHandler::~DisconnectedAppHandler() {} 50 DisconnectedAppHandler::~DisconnectedAppHandler() {}
51 51
52 void DisconnectedAppHandler::OnWindowEmbeddedAppDisconnected( 52 void DisconnectedAppHandler::OnWindowEmbeddedAppDisconnected(
53 ::ui::Window* window) { 53 ui::Window* window) {
54 if (!IsContainer(window)) 54 if (!IsContainer(window))
55 window->Destroy(); 55 window->Destroy();
56 } 56 }
57 57
58 void DisconnectedAppHandler::OnTreeChanging(const TreeChangeParams& params) { 58 void DisconnectedAppHandler::OnTreeChanging(const TreeChangeParams& params) {
59 if (params.old_parent == params.receiver && IsContainer(params.old_parent)) 59 if (params.old_parent == params.receiver && IsContainer(params.old_parent))
60 Remove(params.target); 60 Remove(params.target);
61 61
62 if (params.new_parent == params.receiver && IsContainer(params.new_parent)) 62 if (params.new_parent == params.receiver && IsContainer(params.new_parent))
63 Add(params.target); 63 Add(params.target);
64 64
65 ::ui::WindowTracker::OnTreeChanging(params); 65 ui::WindowTracker::OnTreeChanging(params);
66 } 66 }
67 67
68 } // namespace mus 68 } // namespace mus
69 } // namespace ash 69 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/disconnected_app_handler.h ('k') | ash/mus/frame/move_event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698