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

Unified Diff: services/ui/ws/window_tree.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/window_server.cc ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree.cc
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
index f51b6ecbf80318f7f24e4524da7ad98e2e604b80..e4ad6630a5854f92e9733b038600869c49ff494d 100644
--- a/services/ui/ws/window_tree.cc
+++ b/services/ui/ws/window_tree.cc
@@ -585,10 +585,6 @@ void WindowTree::ProcessWindowHierarchyChanged(const ServerWindow* window,
const ServerWindow* old_parent,
bool originated_change) {
const bool knows_new = new_parent && IsWindowKnown(new_parent);
- if (originated_change && !IsWindowKnown(window) && knows_new) {
- std::vector<const ServerWindow*> unused;
- GetUnknownWindowsFrom(window, &unused);
- }
if (originated_change || (window_server_->current_operation_type() ==
OperationType::DELETE_WINDOW) ||
(window_server_->current_operation_type() == OperationType::EMBED) ||
@@ -899,9 +895,16 @@ bool WindowTree::DeleteWindowImpl(WindowTree* source, ServerWindow* window) {
void WindowTree::GetUnknownWindowsFrom(
const ServerWindow* window,
std::vector<const ServerWindow*>* windows) {
- if (IsWindowKnown(window) || !access_policy_->CanGetWindowTree(window))
+ if (!access_policy_->CanGetWindowTree(window))
return;
+
+ // This function is called in the context of a hierarchy change when the
+ // parent wasn't known. We need to tell the client about the window so that
+ // it can set the parent correctly.
windows->push_back(window);
+ if (IsWindowKnown(window))
+ return;
+
// There are two cases where this gets hit:
// . During init, in which case using the window id as the client id is
// fine.
« no previous file with comments | « services/ui/ws/window_server.cc ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698