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

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

Issue 2072343002: Changes how window manager obtains WindowTree from mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include Created 4 years, 6 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
Index: components/mus/ws/window_manager_window_tree_factory.h
diff --git a/components/mus/ws/window_manager_window_tree_factory.h b/components/mus/ws/window_manager_window_tree_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..7aed6c9dd19706bb130e77789b1a2a397392fca4
--- /dev/null
+++ b/components/mus/ws/window_manager_window_tree_factory.h
@@ -0,0 +1,75 @@
+// 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_WINDOW_TREE_FACTORY_H_
+#define COMPONENTS_MUS_WS_WINDOW_MANAGER_WINDOW_TREE_FACTORY_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "components/mus/public/interfaces/window_manager_window_tree_factory.mojom.h"
+#include "components/mus/ws/user_id.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace mus {
+namespace ws {
+
+class ServerWindow;
+class WindowManagerWindowTreeFactorySet;
+class WindowServer;
+class WindowTree;
+
+namespace test {
+class WindowManagerWindowTreeFactorySetTestApi;
+}
+
+// Implementation of mojom::WindowManagerWindowTreeFactory.
+class WindowManagerWindowTreeFactory
+ : public mojom::WindowManagerWindowTreeFactory {
+ public:
+ WindowManagerWindowTreeFactory(
+ WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set,
+ const UserId& user_id,
+ mojo::InterfaceRequest<mojom::WindowManagerWindowTreeFactory> request);
+ ~WindowManagerWindowTreeFactory() override;
+
+ const UserId& user_id() const { return user_id_; }
+
+ WindowTree* window_tree() { return window_tree_; }
+
+ void BindPendingRequest();
+
+ // mojom::WindowManagerWindowTreeFactory:
+ void CreateWindowTree(mojom::WindowTreeRequest window_tree_request,
+ mojom::WindowTreeClientPtr window_tree_client) override;
+
+ private:
+ friend class test::WindowManagerWindowTreeFactorySetTestApi;
+ struct PendingRequest;
+
+ // Used by tests.
+ WindowManagerWindowTreeFactory(WindowManagerWindowTreeFactorySet* registry,
+ const UserId& user_id);
+
+ WindowServer* GetWindowServer();
+
+ void SetWindowTree(WindowTree* window_tree);
+
+ WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set_;
+ const UserId user_id_;
+ mojo::Binding<mojom::WindowManagerWindowTreeFactory> binding_;
+
+ // Owned by WindowServer.
+ WindowTree* window_tree_;
+
+ std::unique_ptr<PendingRequest> pending_request_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowManagerWindowTreeFactory);
+};
+
+} // namespace ws
+} // namespace mus
+
+#endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_WINDOW_TREE_FACTORY_H_
« no previous file with comments | « components/mus/ws/window_manager_factory_service.cc ('k') | components/mus/ws/window_manager_window_tree_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698