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

Side by Side Diff: ash/common/wm/container_finder.cc

Issue 2350953009: Centralizes more shared code between ash and mash (Closed)
Patch Set: feedback Created 4 years, 3 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/aura/wm_window_aura.cc ('k') | ash/common/wm/workspace/workspace_layout_manager.cc » ('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/common/wm/container_finder.h" 5 #include "ash/common/wm/container_finder.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/common/wm/always_on_top_controller.h" 9 #include "ash/common/wm/always_on_top_controller.h"
10 #include "ash/common/wm/root_window_finder.h" 10 #include "ash/common/wm/root_window_finder.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 int window_container_id = 46 int window_container_id =
47 window->GetTransientParent()->GetParent()->GetShellWindowId(); 47 window->GetTransientParent()->GetParent()->GetShellWindowId();
48 if (window_container_id < kShellWindowId_LockScreenContainer) 48 if (window_container_id < kShellWindowId_LockScreenContainer)
49 return root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer); 49 return root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer);
50 return root->GetChildByShellWindowId(kShellWindowId_LockSystemModalContainer); 50 return root->GetChildByShellWindowId(kShellWindowId_LockSystemModalContainer);
51 } 51 }
52 52
53 WmWindow* GetContainerFromAlwaysOnTopController(WmWindow* root, 53 WmWindow* GetContainerFromAlwaysOnTopController(WmWindow* root,
54 WmWindow* window) { 54 WmWindow* window) {
55 return root->GetRootWindowController() 55 return root->GetRootWindowController()
56 ->GetAlwaysOnTopController() 56 ->always_on_top_controller()
57 ->GetContainer(window); 57 ->GetContainer(window);
58 } 58 }
59 59
60 } // namespace 60 } // namespace
61 61
62 WmWindow* GetContainerForWindow(WmWindow* window) { 62 WmWindow* GetContainerForWindow(WmWindow* window) {
63 WmWindow* parent = window->GetParent(); 63 WmWindow* parent = window->GetParent();
64 // The first parent with an explicit shell window ID is the container. 64 // The first parent with an explicit shell window ID is the container.
65 while (parent && parent->GetShellWindowId() == kShellWindowId_Invalid) 65 while (parent && parent->GetShellWindowId() == kShellWindowId_Invalid)
66 parent = parent->GetParent(); 66 parent = parent->GetParent();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (priority_root && priority_root->Contains(container)) 120 if (priority_root && priority_root->Contains(container))
121 containers.insert(containers.begin(), container); 121 containers.insert(containers.begin(), container);
122 else 122 else
123 containers.push_back(container); 123 containers.push_back(container);
124 } 124 }
125 return containers; 125 return containers;
126 } 126 }
127 127
128 } // namespace wm 128 } // namespace wm
129 } // namespace ash 129 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/wm_window_aura.cc ('k') | ash/common/wm/workspace/workspace_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698