| 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 "components/mus/ws/window_server.h" | 5 #include "components/mus/ws/window_server.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 208 |
| 209 void WindowServer::OnTreeMessagedClient(ClientSpecificId id) { | 209 void WindowServer::OnTreeMessagedClient(ClientSpecificId id) { |
| 210 if (current_operation_) | 210 if (current_operation_) |
| 211 current_operation_->MarkTreeAsMessaged(id); | 211 current_operation_->MarkTreeAsMessaged(id); |
| 212 } | 212 } |
| 213 | 213 |
| 214 bool WindowServer::DidTreeMessageClient(ClientSpecificId id) const { | 214 bool WindowServer::DidTreeMessageClient(ClientSpecificId id) const { |
| 215 return current_operation_ && current_operation_->DidMessageTree(id); | 215 return current_operation_ && current_operation_->DidMessageTree(id); |
| 216 } | 216 } |
| 217 | 217 |
| 218 mojom::ViewportMetricsPtr WindowServer::GetViewportMetricsForWindow( | |
| 219 const ServerWindow* window) { | |
| 220 const Display* display = display_manager_->GetDisplayContaining(window); | |
| 221 if (display) | |
| 222 return display->GetViewportMetrics().Clone(); | |
| 223 | |
| 224 if (!display_manager_->displays().empty()) | |
| 225 return (*display_manager_->displays().begin()) | |
| 226 ->GetViewportMetrics() | |
| 227 .Clone(); | |
| 228 | |
| 229 mojom::ViewportMetricsPtr metrics = mojom::ViewportMetrics::New(); | |
| 230 metrics->size_in_pixels = mojo::Size::New(); | |
| 231 return metrics; | |
| 232 } | |
| 233 | |
| 234 const WindowTree* WindowServer::GetTreeWithRoot( | 218 const WindowTree* WindowServer::GetTreeWithRoot( |
| 235 const ServerWindow* window) const { | 219 const ServerWindow* window) const { |
| 236 if (!window) | 220 if (!window) |
| 237 return nullptr; | 221 return nullptr; |
| 238 for (auto& pair : tree_map_) { | 222 for (auto& pair : tree_map_) { |
| 239 if (pair.second->HasRoot(window)) | 223 if (pair.second->HasRoot(window)) |
| 240 return pair.second.get(); | 224 return pair.second.get(); |
| 241 } | 225 } |
| 242 return nullptr; | 226 return nullptr; |
| 243 } | 227 } |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 void WindowServer::OnFirstDisplayReady() { | 682 void WindowServer::OnFirstDisplayReady() { |
| 699 delegate_->OnFirstDisplayReady(); | 683 delegate_->OnFirstDisplayReady(); |
| 700 } | 684 } |
| 701 | 685 |
| 702 void WindowServer::OnNoMoreDisplays() { | 686 void WindowServer::OnNoMoreDisplays() { |
| 703 delegate_->OnNoMoreDisplays(); | 687 delegate_->OnNoMoreDisplays(); |
| 704 } | 688 } |
| 705 | 689 |
| 706 } // namespace ws | 690 } // namespace ws |
| 707 } // namespace mus | 691 } // namespace mus |
| OLD | NEW |