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

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

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: Fix container root lookup. Don't need to initialize container id for unit test. Created 4 years, 1 month 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 | « no previous file | ash/mus/BUILD.gn » ('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/wm/always_on_top_controller.h" 8 #include "ash/common/wm/always_on_top_controller.h"
9 #include "ash/common/wm/root_window_finder.h" 9 #include "ash/common/wm/root_window_finder.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 WmWindow* GetDefaultParent(WmWindow* context, 70 WmWindow* GetDefaultParent(WmWindow* context,
71 WmWindow* window, 71 WmWindow* window,
72 const gfx::Rect& bounds) { 72 const gfx::Rect& bounds) {
73 WmWindow* target_root = nullptr; 73 WmWindow* target_root = nullptr;
74 WmWindow* transient_parent = window->GetTransientParent(); 74 WmWindow* transient_parent = window->GetTransientParent();
75 if (transient_parent) { 75 if (transient_parent) {
76 // Transient window should use the same root as its transient parent. 76 // Transient window should use the same root as its transient parent.
77 target_root = transient_parent->GetRootWindow(); 77 target_root = transient_parent->GetRootWindow();
78 } else { 78 } else {
79 target_root = FindContainerRoot(context->GetShell(), bounds); 79 target_root = context->GetRootWindow();
mfomitchev 2016/11/15 20:29:34 This makes sense to me, but the original way seems
thanhph 2016/11/15 21:09:55 If the bounds is correct, then this function FindC
80 if (!target_root)
81 target_root = FindContainerRoot(context->GetShell(), bounds);
80 } 82 }
81 83
82 switch (window->GetType()) { 84 switch (window->GetType()) {
83 case ui::wm::WINDOW_TYPE_NORMAL: 85 case ui::wm::WINDOW_TYPE_NORMAL:
84 case ui::wm::WINDOW_TYPE_POPUP: 86 case ui::wm::WINDOW_TYPE_POPUP:
85 if (window->IsSystemModal()) 87 if (window->IsSystemModal())
86 return GetSystemModalContainer(target_root, window); 88 return GetSystemModalContainer(target_root, window);
87 if (HasTransientParentWindow(window)) 89 if (HasTransientParentWindow(window))
88 return GetContainerForWindow(window->GetTransientParent()); 90 return GetContainerForWindow(window->GetTransientParent());
89 return GetContainerFromAlwaysOnTopController(target_root, window); 91 return GetContainerFromAlwaysOnTopController(target_root, window);
(...skipping 30 matching lines...) Expand all
120 if (priority_root && priority_root->Contains(container)) 122 if (priority_root && priority_root->Contains(container))
121 containers.insert(containers.begin(), container); 123 containers.insert(containers.begin(), container);
122 else 124 else
123 containers.push_back(container); 125 containers.push_back(container);
124 } 126 }
125 return containers; 127 return containers;
126 } 128 }
127 129
128 } // namespace wm 130 } // namespace wm
129 } // namespace ash 131 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698