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

Unified 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, 10 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_manager_state.cc
diff --git a/components/mus/ws/window_manager_state.cc b/components/mus/ws/window_manager_state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..09dc5289519c74a8ce9f913936d55510829c90f0
--- /dev/null
+++ b/components/mus/ws/window_manager_state.cc
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/mus/ws/window_manager_state.h"
+
+#include "components/mus/ws/connection_manager.h"
+#include "components/mus/ws/server_window.h"
+
+namespace mus {
+namespace ws {
+
+WindowManagerState::WindowManagerState(WindowTreeHostImpl* tree_host)
+ : WindowManagerState(tree_host, false, 0u) {}
+
+WindowManagerState::WindowManagerState(WindowTreeHostImpl* tree_host,
+ uint32_t user_id)
+ : WindowManagerState(tree_host, true, user_id) {}
+
+WindowManagerState::~WindowManagerState() {}
+
+WindowManagerState::WindowManagerState(WindowTreeHostImpl* tree_host,
+ bool is_user_id_valid,
+ uint32_t user_id)
+ : tree_host_(tree_host),
+ is_user_id_valid_(is_user_id_valid),
+ user_id_(user_id) {
+ ConnectionManager* connection_manager = tree_host_->connection_manager();
+ root_.reset(connection_manager->CreateServerWindow(
+ RootWindowId(connection_manager->GetAndAdvanceNextHostId()),
+ ServerWindow::Properties()));
+ // Our root is always a child of the WindowTreeHostImpl's root. Do this
+ // before the WindowTree has been created so that the client doesn't get
+ // notified of the add, bounds change and visibility change.
+ root_->SetBounds(gfx::Rect(tree_host->root_window()->bounds().size()));
+ root_->SetVisible(true);
+ tree_host->root_window()->Add(root_.get());
+}
+
+} // namespace ws
+} // namespace mus
« 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