| 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 "components/mus/ws/window_manager_state.h" | 5 #include "components/mus/ws/window_manager_state.h" |
| 6 | 6 |
| 7 #include "components/mus/ws/connection_manager.h" | 7 #include "components/mus/ws/connection_manager.h" |
| 8 #include "components/mus/ws/server_window.h" | 8 #include "components/mus/ws/server_window.h" |
| 9 #include "mojo/shell/public/interfaces/connector.mojom.h" |
| 9 | 10 |
| 10 namespace mus { | 11 namespace mus { |
| 11 namespace ws { | 12 namespace ws { |
| 12 | 13 |
| 13 WindowManagerState::WindowManagerState(Display* display) | 14 WindowManagerState::WindowManagerState(Display* display) |
| 14 : WindowManagerState(display, false, 0u) {} | 15 : WindowManagerState(display, false, mojo::shell::mojom::kRootUserID) {} |
| 15 | 16 |
| 16 WindowManagerState::WindowManagerState(Display* display, uint32_t user_id) | 17 WindowManagerState::WindowManagerState(Display* display, const UserId& user_id) |
| 17 : WindowManagerState(display, true, user_id) {} | 18 : WindowManagerState(display, true, user_id) {} |
| 18 | 19 |
| 19 WindowManagerState::~WindowManagerState() {} | 20 WindowManagerState::~WindowManagerState() {} |
| 20 | 21 |
| 21 WindowManagerState::WindowManagerState(Display* display, | 22 WindowManagerState::WindowManagerState(Display* display, |
| 22 bool is_user_id_valid, | 23 bool is_user_id_valid, |
| 23 uint32_t user_id) | 24 const UserId& user_id) |
| 24 : display_(display), | 25 : display_(display), |
| 25 is_user_id_valid_(is_user_id_valid), | 26 is_user_id_valid_(is_user_id_valid), |
| 26 user_id_(user_id) { | 27 user_id_(user_id) { |
| 27 ConnectionManager* connection_manager = display_->connection_manager(); | 28 ConnectionManager* connection_manager = display_->connection_manager(); |
| 28 root_.reset(connection_manager->CreateServerWindow( | 29 root_.reset(connection_manager->CreateServerWindow( |
| 29 RootWindowId(connection_manager->GetAndAdvanceNextRootId()), | 30 RootWindowId(connection_manager->GetAndAdvanceNextRootId()), |
| 30 ServerWindow::Properties())); | 31 ServerWindow::Properties())); |
| 31 // Our root is always a child of the Display's root. Do this | 32 // Our root is always a child of the Display's root. Do this |
| 32 // before the WindowTree has been created so that the client doesn't get | 33 // before the WindowTree has been created so that the client doesn't get |
| 33 // notified of the add, bounds change and visibility change. | 34 // notified of the add, bounds change and visibility change. |
| 34 root_->SetBounds(gfx::Rect(display->root_window()->bounds().size())); | 35 root_->SetBounds(gfx::Rect(display->root_window()->bounds().size())); |
| 35 root_->SetVisible(true); | 36 root_->SetVisible(true); |
| 36 display->root_window()->Add(root_.get()); | 37 display->root_window()->Add(root_.get()); |
| 37 } | 38 } |
| 38 | 39 |
| 39 } // namespace ws | 40 } // namespace ws |
| 40 } // namespace mus | 41 } // namespace mus |
| OLD | NEW |