| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_manager_display_root.h" | 5 #include "services/ui/ws/window_manager_display_root.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "services/ui/public/interfaces/window_manager.mojom.h" | 10 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // before the WindowTree has been created so that the client doesn't get | 34 // before the WindowTree has been created so that the client doesn't get |
| 35 // notified of the add, bounds change and visibility change. | 35 // notified of the add, bounds change and visibility change. |
| 36 root_->SetBounds(gfx::Rect(display->root_window()->bounds().size()), | 36 root_->SetBounds(gfx::Rect(display->root_window()->bounds().size()), |
| 37 allocator_.GenerateId()); | 37 allocator_.GenerateId()); |
| 38 root_->SetVisible(true); | 38 root_->SetVisible(true); |
| 39 display->root_window()->Add(root_.get()); | 39 display->root_window()->Add(root_.get()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 WindowManagerDisplayRoot::~WindowManagerDisplayRoot() {} | 42 WindowManagerDisplayRoot::~WindowManagerDisplayRoot() {} |
| 43 | 43 |
| 44 const ServerWindow* WindowManagerDisplayRoot::GetClientVisibileRoot() const { | 44 const ServerWindow* WindowManagerDisplayRoot::GetClientVisibleRoot() const { |
| 45 if (window_manager_state_->window_tree() | 45 if (window_manager_state_->window_tree() |
| 46 ->automatically_create_display_roots()) { | 46 ->automatically_create_display_roots()) { |
| 47 return root_.get(); | 47 return root_.get(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 return root_->children().empty() ? nullptr : root_->children()[0]; | 50 return root_->children().empty() ? nullptr : root_->children()[0]; |
| 51 } | 51 } |
| 52 | 52 |
| 53 WindowServer* WindowManagerDisplayRoot::window_server() { | 53 WindowServer* WindowManagerDisplayRoot::window_server() { |
| 54 return display_->window_server(); | 54 return display_->window_server(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace ws | 57 } // namespace ws |
| 58 } // namespace ui | 58 } // namespace ui |
| OLD | NEW |