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

Unified Diff: components/mus/ws/window_manager_state.h

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_factory_service.cc ('k') | components/mus/ws/window_manager_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_manager_state.h
diff --git a/components/mus/ws/window_manager_state.h b/components/mus/ws/window_manager_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..48c776d11ceff14fabce8b8989314c21ac043f9c
--- /dev/null
+++ b/components/mus/ws/window_manager_state.h
@@ -0,0 +1,58 @@
+// 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.
+
+#ifndef COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_
+#define COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_
+
+#include <stdint.h>
+
+#include "base/memory/scoped_ptr.h"
+
+namespace mus {
+namespace ws {
+
+class ServerWindow;
+class WindowTreeHostImpl;
+class WindowTreeImpl;
+
+// Manages the state associated with a connection to a WindowManager for
+// a specific user.
+class WindowManagerState {
+ public:
+ // Creates a WindowManagerState that can host content from any user.
+ explicit WindowManagerState(WindowTreeHostImpl* tree_host);
+ WindowManagerState(WindowTreeHostImpl* tree_host, uint32_t user_id);
+ ~WindowManagerState();
+
+ bool is_user_id_valid() const { return is_user_id_valid_; }
+
+ ServerWindow* root() { return root_.get(); }
+ const ServerWindow* root() const { return root_.get(); }
+
+ WindowTreeImpl* tree() { return tree_; }
+ const WindowTreeImpl* tree() const { return tree_; }
+
+ private:
+ friend class WindowTreeHostImpl;
+
+ WindowManagerState(WindowTreeHostImpl* tree_host,
+ bool is_user_id_valid,
+ uint32_t user_id);
+
+ WindowTreeHostImpl* tree_host_;
+ // If this was created implicitly by a call
+ // WindowTreeHostFactory::CreateWindowTreeHost(), then |is_user_id_valid_|
+ // is false.
+ const bool is_user_id_valid_;
+ const uint32_t user_id_;
+ scoped_ptr<ServerWindow> root_;
+ WindowTreeImpl* tree_ = nullptr;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowManagerState);
+};
+
+} // namespace ws
+} // namespace mus
+
+#endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_
« no previous file with comments | « components/mus/ws/window_manager_factory_service.cc ('k') | components/mus/ws/window_manager_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698