| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/display.h" | 5 #include "services/ui/ws/display.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "services/ui/ws/window_manager_display_root.h" | 22 #include "services/ui/ws/window_manager_display_root.h" |
| 23 #include "services/ui/ws/window_manager_state.h" | 23 #include "services/ui/ws/window_manager_state.h" |
| 24 #include "services/ui/ws/window_manager_window_tree_factory.h" | 24 #include "services/ui/ws/window_manager_window_tree_factory.h" |
| 25 #include "services/ui/ws/window_server.h" | 25 #include "services/ui/ws/window_server.h" |
| 26 #include "services/ui/ws/window_server_delegate.h" | 26 #include "services/ui/ws/window_server_delegate.h" |
| 27 #include "services/ui/ws/window_tree.h" | 27 #include "services/ui/ws/window_tree.h" |
| 28 #include "services/ui/ws/window_tree_binding.h" | 28 #include "services/ui/ws/window_tree_binding.h" |
| 29 #include "ui/base/cursor/cursor.h" | 29 #include "ui/base/cursor/cursor.h" |
| 30 #include "ui/display/screen.h" | 30 #include "ui/display/screen.h" |
| 31 | 31 |
| 32 #if defined(USE_OZONE) |
| 33 #include "ui/ozone/public/ozone_platform.h" |
| 34 #endif |
| 35 |
| 32 namespace ui { | 36 namespace ui { |
| 33 namespace ws { | 37 namespace ws { |
| 34 | 38 |
| 35 Display::Display(WindowServer* window_server) | 39 Display::Display(WindowServer* window_server) |
| 36 : window_server_(window_server), | 40 : window_server_(window_server), |
| 37 last_cursor_(mojom::CursorType::CURSOR_NULL) { | 41 last_cursor_(mojom::CursorType::CURSOR_NULL) { |
| 38 window_server_->window_manager_window_tree_factory_set()->AddObserver(this); | 42 window_server_->window_manager_window_tree_factory_set()->AddObserver(this); |
| 39 window_server_->user_id_tracker()->AddObserver(this); | 43 window_server_->user_id_tracker()->AddObserver(this); |
| 40 } | 44 } |
| 41 | 45 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 display_manager()->OnDisplayAcceleratedWidgetAvailable(this); | 273 display_manager()->OnDisplayAcceleratedWidgetAvailable(this); |
| 270 InitWindowManagerDisplayRoots(); | 274 InitWindowManagerDisplayRoots(); |
| 271 } | 275 } |
| 272 | 276 |
| 273 void Display::OnNativeCaptureLost() { | 277 void Display::OnNativeCaptureLost() { |
| 274 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot(); | 278 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot(); |
| 275 if (display_root) | 279 if (display_root) |
| 276 display_root->window_manager_state()->SetCapture(nullptr, kInvalidClientId); | 280 display_root->window_manager_state()->SetCapture(nullptr, kInvalidClientId); |
| 277 } | 281 } |
| 278 | 282 |
| 283 OzonePlatform* Display::GetOzonePlatform() { |
| 284 #if defined(USE_OZONE) |
| 285 return OzonePlatform::GetInstance(); |
| 286 #else |
| 287 return nullptr; |
| 288 #endif |
| 289 } |
| 290 |
| 279 void Display::OnViewportMetricsChanged( | 291 void Display::OnViewportMetricsChanged( |
| 280 const display::ViewportMetrics& metrics) { | 292 const display::ViewportMetrics& metrics) { |
| 281 platform_display_->UpdateViewportMetrics(metrics); | 293 platform_display_->UpdateViewportMetrics(metrics); |
| 282 | 294 |
| 283 if (root_->bounds().size() == metrics.bounds_in_pixels.size()) | 295 if (root_->bounds().size() == metrics.bounds_in_pixels.size()) |
| 284 return; | 296 return; |
| 285 | 297 |
| 286 gfx::Rect new_bounds(metrics.bounds_in_pixels.size()); | 298 gfx::Rect new_bounds(metrics.bounds_in_pixels.size()); |
| 287 root_->SetBounds(new_bounds, allocator_.GenerateId()); | 299 root_->SetBounds(new_bounds, allocator_.GenerateId()); |
| 288 for (auto& pair : window_manager_display_root_map_) | 300 for (auto& pair : window_manager_display_root_map_) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 400 |
| 389 UserActivityMonitor* activity_monitor = | 401 UserActivityMonitor* activity_monitor = |
| 390 window_server_->GetUserActivityMonitorForUser( | 402 window_server_->GetUserActivityMonitorForUser( |
| 391 window_server_->user_id_tracker()->active_id()); | 403 window_server_->user_id_tracker()->active_id()); |
| 392 activity_monitor->OnUserActivity(); | 404 activity_monitor->OnUserActivity(); |
| 393 return EventDispatchDetails(); | 405 return EventDispatchDetails(); |
| 394 } | 406 } |
| 395 | 407 |
| 396 } // namespace ws | 408 } // namespace ws |
| 397 } // namespace ui | 409 } // namespace ui |
| OLD | NEW |