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