| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 display ? display->GetFocusedWindow() : nullptr; | 124 display ? display->GetFocusedWindow() : nullptr; |
| 125 if (focused_window) | 125 if (focused_window) |
| 126 focused_window = access_policy_->GetWindowForFocusChange(focused_window); | 126 focused_window = access_policy_->GetWindowForFocusChange(focused_window); |
| 127 ClientWindowId focused_window_id; | 127 ClientWindowId focused_window_id; |
| 128 if (focused_window) | 128 if (focused_window) |
| 129 IsWindowKnown(focused_window, &focused_window_id); | 129 IsWindowKnown(focused_window, &focused_window_id); |
| 130 | 130 |
| 131 const bool drawn = root->parent() && root->parent()->IsDrawn(); | 131 const bool drawn = root->parent() && root->parent()->IsDrawn(); |
| 132 client()->OnEmbed(id_, WindowToWindowData(to_send.front()), std::move(tree), | 132 client()->OnEmbed(id_, WindowToWindowData(to_send.front()), std::move(tree), |
| 133 display_id, focused_window_id.id, drawn, | 133 display_id, focused_window_id.id, drawn, |
| 134 root->frame_sink_id()); | 134 root->frame_sink_id(), root->current_local_surface_id()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void WindowTree::ConfigureWindowManager() { | 137 void WindowTree::ConfigureWindowManager() { |
| 138 // ConfigureWindowManager() should be called early on, before anything | 138 // ConfigureWindowManager() should be called early on, before anything |
| 139 // else. |waiting_for_top_level_window_info_| must be null as if | 139 // else. |waiting_for_top_level_window_info_| must be null as if |
| 140 // |waiting_for_top_level_window_info_| is non-null it means we're about to | 140 // |waiting_for_top_level_window_info_| is non-null it means we're about to |
| 141 // create an associated interface, which doesn't work with pause/resume. | 141 // create an associated interface, which doesn't work with pause/resume. |
| 142 // TODO(sky): DCHECK temporary until 626869 is sorted out. | 142 // TODO(sky): DCHECK temporary until 626869 is sorted out. |
| 143 DCHECK(!waiting_for_top_level_window_info_); | 143 DCHECK(!waiting_for_top_level_window_info_); |
| 144 DCHECK(!window_manager_internal_); | 144 DCHECK(!window_manager_internal_); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 DCHECK_EQ(0u, client_id_to_window_id_map_.count(client_window_id)); | 209 DCHECK_EQ(0u, client_id_to_window_id_map_.count(client_window_id)); |
| 210 client_id_to_window_id_map_[client_window_id] = root->id(); | 210 client_id_to_window_id_map_[client_window_id] = root->id(); |
| 211 window_id_to_client_id_map_[root->id()] = client_window_id; | 211 window_id_to_client_id_map_[root->id()] = client_window_id; |
| 212 roots_.insert(root); | 212 roots_.insert(root); |
| 213 | 213 |
| 214 Display* ws_display = GetDisplay(root); | 214 Display* ws_display = GetDisplay(root); |
| 215 DCHECK(ws_display); | 215 DCHECK(ws_display); |
| 216 | 216 |
| 217 window_manager_internal_->WmNewDisplayAdded( | 217 window_manager_internal_->WmNewDisplayAdded( |
| 218 ws_display->GetDisplay(), WindowToWindowData(root), | 218 ws_display->GetDisplay(), WindowToWindowData(root), |
| 219 root->parent()->IsDrawn(), root->frame_sink_id()); | 219 root->parent()->IsDrawn(), root->frame_sink_id(), |
| 220 root->current_local_surface_id()); |
| 220 } | 221 } |
| 221 | 222 |
| 222 void WindowTree::OnWindowDestroyingTreeImpl(WindowTree* tree) { | 223 void WindowTree::OnWindowDestroyingTreeImpl(WindowTree* tree) { |
| 223 if (event_source_wms_ && event_source_wms_->window_tree() == tree) | 224 if (event_source_wms_ && event_source_wms_->window_tree() == tree) |
| 224 event_source_wms_ = nullptr; | 225 event_source_wms_ = nullptr; |
| 225 | 226 |
| 226 // Notify our client if |tree| was embedded in any of our windows. | 227 // Notify our client if |tree| was embedded in any of our windows. |
| 227 for (const auto* tree_root : tree->roots_) { | 228 for (const auto* tree_root : tree->roots_) { |
| 228 const bool owns_tree_root = tree_root->id().client_id == id_; | 229 const bool owns_tree_root = tree_root->id().client_id == id_; |
| 229 if (owns_tree_root) { | 230 if (owns_tree_root) { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 } | 551 } |
| 551 client_id_to_window_id_map_[waiting_for_top_level_window_info | 552 client_id_to_window_id_map_[waiting_for_top_level_window_info |
| 552 ->client_window_id] = window->id(); | 553 ->client_window_id] = window->id(); |
| 553 window_id_to_client_id_map_[window->id()] = | 554 window_id_to_client_id_map_[window->id()] = |
| 554 waiting_for_top_level_window_info->client_window_id; | 555 waiting_for_top_level_window_info->client_window_id; |
| 555 roots_.insert(window); | 556 roots_.insert(window); |
| 556 Display* display = GetDisplay(window); | 557 Display* display = GetDisplay(window); |
| 557 int64_t display_id = display ? display->GetId() : display::kInvalidDisplayId; | 558 int64_t display_id = display ? display->GetId() : display::kInvalidDisplayId; |
| 558 const bool drawn = window->parent() && window->parent()->IsDrawn(); | 559 const bool drawn = window->parent() && window->parent()->IsDrawn(); |
| 559 client()->OnTopLevelCreated(client_change_id, WindowToWindowData(window), | 560 client()->OnTopLevelCreated(client_change_id, WindowToWindowData(window), |
| 560 display_id, drawn, window->frame_sink_id()); | 561 display_id, drawn, window->frame_sink_id(), |
| 562 window->current_local_surface_id()); |
| 561 } | 563 } |
| 562 | 564 |
| 563 void WindowTree::AddActivationParent(const ClientWindowId& window_id) { | 565 void WindowTree::AddActivationParent(const ClientWindowId& window_id) { |
| 564 ServerWindow* window = GetWindowByClientId(window_id); | 566 ServerWindow* window = GetWindowByClientId(window_id); |
| 565 if (window) { | 567 if (window) { |
| 566 Display* display = GetDisplay(window); | 568 Display* display = GetDisplay(window); |
| 567 if (display) | 569 if (display) |
| 568 display->AddActivationParent(window); | 570 display->AddActivationParent(window); |
| 569 else | 571 else |
| 570 DVLOG(1) << "AddActivationParent window not associated with display"; | 572 DVLOG(1) << "AddActivationParent window not associated with display"; |
| (...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2279 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2281 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2280 effect_bitmask, callback); | 2282 effect_bitmask, callback); |
| 2281 } | 2283 } |
| 2282 | 2284 |
| 2283 void WindowTree::PerformOnDragDropDone() { | 2285 void WindowTree::PerformOnDragDropDone() { |
| 2284 client()->OnDragDropDone(); | 2286 client()->OnDragDropDone(); |
| 2285 } | 2287 } |
| 2286 | 2288 |
| 2287 } // namespace ws | 2289 } // namespace ws |
| 2288 } // namespace ui | 2290 } // namespace ui |
| OLD | NEW |