Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: components/mus/ws/window_manager_state.cc

Issue 1755223002: Adds WindowManagerManager to mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and WindowManagerState Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/mus/ws/window_manager_state.h ('k') | components/mus/ws/window_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « components/mus/ws/window_manager_state.h ('k') | components/mus/ws/window_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698