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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 void Display::OnDisplayClosed() { | 308 void Display::OnDisplayClosed() { |
309 display_manager()->DestroyDisplay(this); | 309 display_manager()->DestroyDisplay(this); |
310 } | 310 } |
311 | 311 |
312 void Display::OnViewportMetricsChanged(const ViewportMetrics& old_metrics, | 312 void Display::OnViewportMetricsChanged(const ViewportMetrics& old_metrics, |
313 const ViewportMetrics& new_metrics) { | 313 const ViewportMetrics& new_metrics) { |
314 if (!root_) { | 314 if (!root_) { |
315 root_.reset(window_server_->CreateServerWindow( | 315 root_.reset(window_server_->CreateServerWindow( |
316 display_manager()->GetAndAdvanceNextRootId(), | 316 display_manager()->GetAndAdvanceNextRootId(), |
317 ServerWindow::Properties())); | 317 ServerWindow::Properties())); |
318 root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels)); | 318 root_->SetBounds(new_metrics.bounds); |
319 root_->SetVisible(true); | 319 root_->SetVisible(true); |
320 focus_controller_.reset(new FocusController(this, root_.get())); | 320 focus_controller_.reset(new FocusController(this, root_.get())); |
321 focus_controller_->AddObserver(this); | 321 focus_controller_->AddObserver(this); |
322 InitWindowManagerDisplayRootsIfNecessary(); | 322 InitWindowManagerDisplayRootsIfNecessary(); |
323 } else { | 323 } else { |
324 root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels)); | 324 root_->SetBounds(new_metrics.bounds); |
325 const gfx::Rect wm_bounds(root_->bounds().size()); | 325 const gfx::Rect wm_bounds(root_->bounds().size()); |
326 for (auto& pair : window_manager_display_root_map_) | 326 for (auto& pair : window_manager_display_root_map_) |
327 pair.second->root()->SetBounds(wm_bounds); | 327 pair.second->root()->SetBounds(wm_bounds); |
328 } | 328 } |
329 display_manager()->OnDisplayUpdate(this); | 329 display_manager()->OnDisplayUpdate(this); |
330 } | 330 } |
331 | 331 |
332 void Display::OnCompositorFrameDrawn() { | 332 void Display::OnCompositorFrameDrawn() { |
333 std::set<ServerWindow*> windows; | 333 std::set<ServerWindow*> windows; |
334 windows.swap(windows_needing_frame_destruction_); | 334 windows.swap(windows_needing_frame_destruction_); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 } | 424 } |
425 | 425 |
426 void Display::OnWindowManagerWindowTreeFactoryReady( | 426 void Display::OnWindowManagerWindowTreeFactoryReady( |
427 WindowManagerWindowTreeFactory* factory) { | 427 WindowManagerWindowTreeFactory* factory) { |
428 if (!binding_) | 428 if (!binding_) |
429 CreateWindowManagerDisplayRootFromFactory(factory); | 429 CreateWindowManagerDisplayRootFromFactory(factory); |
430 } | 430 } |
431 | 431 |
432 } // namespace ws | 432 } // namespace ws |
433 } // namespace ui | 433 } // namespace ui |
OLD | NEW |