| 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" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "components/mus/ws/display.h" | 13 #include "components/mus/ws/display.h" |
| 14 #include "components/mus/ws/display_binding.h" | 14 #include "components/mus/ws/display_binding.h" |
| 15 #include "components/mus/ws/display_manager.h" | 15 #include "components/mus/ws/display_manager.h" |
| 16 #include "components/mus/ws/operation.h" | 16 #include "components/mus/ws/operation.h" |
| 17 #include "components/mus/ws/server_window.h" | 17 #include "components/mus/ws/server_window.h" |
| 18 #include "components/mus/ws/window_coordinate_conversions.h" | 18 #include "components/mus/ws/window_coordinate_conversions.h" |
| 19 #include "components/mus/ws/window_manager_access_policy.h" | 19 #include "components/mus/ws/window_manager_access_policy.h" |
| 20 #include "components/mus/ws/window_manager_factory_service.h" | 20 #include "components/mus/ws/window_manager_factory_service.h" |
| 21 #include "components/mus/ws/window_manager_state.h" | 21 #include "components/mus/ws/window_manager_state.h" |
| 22 #include "components/mus/ws/window_server_delegate.h" | 22 #include "components/mus/ws/window_server_delegate.h" |
| 23 #include "components/mus/ws/window_tree.h" | 23 #include "components/mus/ws/window_tree.h" |
| 24 #include "components/mus/ws/window_tree_binding.h" | 24 #include "components/mus/ws/window_tree_binding.h" |
| 25 #include "mojo/converters/geometry/geometry_type_converters.h" | |
| 26 #include "mojo/converters/input_events/input_events_type_converters.h" | 25 #include "mojo/converters/input_events/input_events_type_converters.h" |
| 27 #include "mojo/converters/surfaces/surfaces_type_converters.h" | 26 #include "mojo/converters/surfaces/surfaces_type_converters.h" |
| 28 #include "services/shell/public/cpp/connection.h" | 27 #include "services/shell/public/cpp/connection.h" |
| 29 #include "ui/gfx/geometry/size_conversions.h" | 28 #include "ui/gfx/geometry/size_conversions.h" |
| 30 | 29 |
| 31 namespace mus { | 30 namespace mus { |
| 32 namespace ws { | 31 namespace ws { |
| 33 | 32 |
| 34 WindowServer::WindowServer( | 33 WindowServer::WindowServer( |
| 35 WindowServerDelegate* delegate, | 34 WindowServerDelegate* delegate, |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 const Display* display = display_manager_->GetDisplayContaining(window); | 219 const Display* display = display_manager_->GetDisplayContaining(window); |
| 221 if (display) | 220 if (display) |
| 222 return display->GetViewportMetrics().Clone(); | 221 return display->GetViewportMetrics().Clone(); |
| 223 | 222 |
| 224 if (!display_manager_->displays().empty()) | 223 if (!display_manager_->displays().empty()) |
| 225 return (*display_manager_->displays().begin()) | 224 return (*display_manager_->displays().begin()) |
| 226 ->GetViewportMetrics() | 225 ->GetViewportMetrics() |
| 227 .Clone(); | 226 .Clone(); |
| 228 | 227 |
| 229 mojom::ViewportMetricsPtr metrics = mojom::ViewportMetrics::New(); | 228 mojom::ViewportMetricsPtr metrics = mojom::ViewportMetrics::New(); |
| 230 metrics->size_in_pixels = mojo::Size::New(); | |
| 231 return metrics; | 229 return metrics; |
| 232 } | 230 } |
| 233 | 231 |
| 234 const WindowTree* WindowServer::GetTreeWithRoot( | 232 const WindowTree* WindowServer::GetTreeWithRoot( |
| 235 const ServerWindow* window) const { | 233 const ServerWindow* window) const { |
| 236 if (!window) | 234 if (!window) |
| 237 return nullptr; | 235 return nullptr; |
| 238 for (auto& pair : tree_map_) { | 236 for (auto& pair : tree_map_) { |
| 239 if (pair.second->HasRoot(window)) | 237 if (pair.second->HasRoot(window)) |
| 240 return pair.second.get(); | 238 return pair.second.get(); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 void WindowServer::OnFirstDisplayReady() { | 706 void WindowServer::OnFirstDisplayReady() { |
| 709 delegate_->OnFirstDisplayReady(); | 707 delegate_->OnFirstDisplayReady(); |
| 710 } | 708 } |
| 711 | 709 |
| 712 void WindowServer::OnNoMoreDisplays() { | 710 void WindowServer::OnNoMoreDisplays() { |
| 713 delegate_->OnNoMoreDisplays(); | 711 delegate_->OnNoMoreDisplays(); |
| 714 } | 712 } |
| 715 | 713 |
| 716 } // namespace ws | 714 } // namespace ws |
| 717 } // namespace mus | 715 } // namespace mus |
| OLD | NEW |