OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 const ServerWindow* focused_window = | 110 const ServerWindow* focused_window = |
111 display ? display->GetFocusedWindow() : nullptr; | 111 display ? display->GetFocusedWindow() : nullptr; |
112 if (focused_window) | 112 if (focused_window) |
113 focused_window = access_policy_->GetWindowForFocusChange(focused_window); | 113 focused_window = access_policy_->GetWindowForFocusChange(focused_window); |
114 ClientWindowId focused_window_id; | 114 ClientWindowId focused_window_id; |
115 if (focused_window) | 115 if (focused_window) |
116 IsWindowKnown(focused_window, &focused_window_id); | 116 IsWindowKnown(focused_window, &focused_window_id); |
117 | 117 |
118 const bool drawn = root->parent() && root->parent()->IsDrawn(); | 118 const bool drawn = root->parent() && root->parent()->IsDrawn(); |
119 client()->OnEmbed(id_, WindowToWindowData(to_send.front()), std::move(tree), | 119 client()->OnEmbed(id_, WindowToWindowData(to_send.front()), std::move(tree), |
120 display_id, focused_window_id.id, drawn); | 120 display_id, focused_window_id.id, drawn, |
| 121 root->frame_sink_id()); |
121 } | 122 } |
122 | 123 |
123 void WindowTree::ConfigureWindowManager() { | 124 void WindowTree::ConfigureWindowManager() { |
124 // ConfigureWindowManager() should be called early on, before anything | 125 // ConfigureWindowManager() should be called early on, before anything |
125 // else. |waiting_for_top_level_window_info_| must be null as if | 126 // else. |waiting_for_top_level_window_info_| must be null as if |
126 // |waiting_for_top_level_window_info_| is non-null it means we're about to | 127 // |waiting_for_top_level_window_info_| is non-null it means we're about to |
127 // create an associated interface, which doesn't work with pause/resume. | 128 // create an associated interface, which doesn't work with pause/resume. |
128 // TODO(sky): DCHECK temporary until 626869 is sorted out. | 129 // TODO(sky): DCHECK temporary until 626869 is sorted out. |
129 DCHECK(!waiting_for_top_level_window_info_); | 130 DCHECK(!waiting_for_top_level_window_info_); |
130 DCHECK(!window_manager_internal_); | 131 DCHECK(!window_manager_internal_); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 DCHECK(window_manager_internal_); | 194 DCHECK(window_manager_internal_); |
194 const ClientWindowId client_window_id(WindowIdToTransportId(root->id())); | 195 const ClientWindowId client_window_id(WindowIdToTransportId(root->id())); |
195 DCHECK_EQ(0u, client_id_to_window_id_map_.count(client_window_id)); | 196 DCHECK_EQ(0u, client_id_to_window_id_map_.count(client_window_id)); |
196 client_id_to_window_id_map_[client_window_id] = root->id(); | 197 client_id_to_window_id_map_[client_window_id] = root->id(); |
197 window_id_to_client_id_map_[root->id()] = client_window_id; | 198 window_id_to_client_id_map_[root->id()] = client_window_id; |
198 roots_.insert(root); | 199 roots_.insert(root); |
199 | 200 |
200 Display* ws_display = GetDisplay(root); | 201 Display* ws_display = GetDisplay(root); |
201 DCHECK(ws_display); | 202 DCHECK(ws_display); |
202 | 203 |
203 window_manager_internal_->WmNewDisplayAdded(ws_display->GetDisplay(), | 204 window_manager_internal_->WmNewDisplayAdded( |
204 WindowToWindowData(root), | 205 ws_display->GetDisplay(), WindowToWindowData(root), |
205 root->parent()->IsDrawn()); | 206 root->parent()->IsDrawn(), root->frame_sink_id()); |
206 } | 207 } |
207 | 208 |
208 void WindowTree::OnWindowDestroyingTreeImpl(WindowTree* tree) { | 209 void WindowTree::OnWindowDestroyingTreeImpl(WindowTree* tree) { |
209 if (event_source_wms_ && event_source_wms_->window_tree() == tree) | 210 if (event_source_wms_ && event_source_wms_->window_tree() == tree) |
210 event_source_wms_ = nullptr; | 211 event_source_wms_ = nullptr; |
211 | 212 |
212 // Notify our client if |tree| was embedded in any of our windows. | 213 // Notify our client if |tree| was embedded in any of our windows. |
213 for (const auto* tree_root : tree->roots_) { | 214 for (const auto* tree_root : tree->roots_) { |
214 const bool owns_tree_root = tree_root->id().client_id == id_; | 215 const bool owns_tree_root = tree_root->id().client_id == id_; |
215 if (owns_tree_root) { | 216 if (owns_tree_root) { |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 } | 526 } |
526 client_id_to_window_id_map_[waiting_for_top_level_window_info | 527 client_id_to_window_id_map_[waiting_for_top_level_window_info |
527 ->client_window_id] = window->id(); | 528 ->client_window_id] = window->id(); |
528 window_id_to_client_id_map_[window->id()] = | 529 window_id_to_client_id_map_[window->id()] = |
529 waiting_for_top_level_window_info->client_window_id; | 530 waiting_for_top_level_window_info->client_window_id; |
530 roots_.insert(window); | 531 roots_.insert(window); |
531 Display* display = GetDisplay(window); | 532 Display* display = GetDisplay(window); |
532 int64_t display_id = display ? display->GetId() : display::kInvalidDisplayId; | 533 int64_t display_id = display ? display->GetId() : display::kInvalidDisplayId; |
533 const bool drawn = window->parent() && window->parent()->IsDrawn(); | 534 const bool drawn = window->parent() && window->parent()->IsDrawn(); |
534 client()->OnTopLevelCreated(client_change_id, WindowToWindowData(window), | 535 client()->OnTopLevelCreated(client_change_id, WindowToWindowData(window), |
535 display_id, drawn); | 536 display_id, drawn, window->frame_sink_id()); |
536 } | 537 } |
537 | 538 |
538 void WindowTree::AddActivationParent(const ClientWindowId& window_id) { | 539 void WindowTree::AddActivationParent(const ClientWindowId& window_id) { |
539 ServerWindow* window = GetWindowByClientId(window_id); | 540 ServerWindow* window = GetWindowByClientId(window_id); |
540 if (window) { | 541 if (window) { |
541 Display* display = GetDisplay(window); | 542 Display* display = GetDisplay(window); |
542 if (display) | 543 if (display) |
543 display->AddActivationParent(window); | 544 display->AddActivationParent(window); |
544 else | 545 else |
545 DVLOG(1) << "AddActivationParent window not associated with display"; | 546 DVLOG(1) << "AddActivationParent window not associated with display"; |
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2206 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2207 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
2207 effect_bitmask, callback); | 2208 effect_bitmask, callback); |
2208 } | 2209 } |
2209 | 2210 |
2210 void WindowTree::PerformOnDragDropDone() { | 2211 void WindowTree::PerformOnDragDropDone() { |
2211 client()->OnDragDropDone(); | 2212 client()->OnDragDropDone(); |
2212 } | 2213 } |
2213 | 2214 |
2214 } // namespace ws | 2215 } // namespace ws |
2215 } // namespace ui | 2216 } // namespace ui |
OLD | NEW |