| 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 #ifndef COMPONENTS_MUS_WS_WINDOW_MANAGER_WINDOW_TREE_FACTORY_H_ | |
| 6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_WINDOW_TREE_FACTORY_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "components/mus/public/interfaces/window_manager_window_tree_factory.mo
jom.h" | |
| 11 #include "components/mus/ws/user_id.h" | |
| 12 #include "mojo/public/cpp/bindings/binding.h" | |
| 13 | |
| 14 namespace mus { | |
| 15 namespace ws { | |
| 16 | |
| 17 class ServerWindow; | |
| 18 class WindowManagerWindowTreeFactorySet; | |
| 19 class WindowServer; | |
| 20 class WindowTree; | |
| 21 | |
| 22 namespace test { | |
| 23 class WindowManagerWindowTreeFactorySetTestApi; | |
| 24 } | |
| 25 | |
| 26 // Implementation of mojom::WindowManagerWindowTreeFactory. | |
| 27 class WindowManagerWindowTreeFactory | |
| 28 : public mojom::WindowManagerWindowTreeFactory { | |
| 29 public: | |
| 30 WindowManagerWindowTreeFactory( | |
| 31 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set, | |
| 32 const UserId& user_id, | |
| 33 mojo::InterfaceRequest<mojom::WindowManagerWindowTreeFactory> request); | |
| 34 ~WindowManagerWindowTreeFactory() override; | |
| 35 | |
| 36 const UserId& user_id() const { return user_id_; } | |
| 37 | |
| 38 WindowTree* window_tree() { return window_tree_; } | |
| 39 | |
| 40 // mojom::WindowManagerWindowTreeFactory: | |
| 41 void CreateWindowTree(mojom::WindowTreeRequest window_tree_request, | |
| 42 mojom::WindowTreeClientPtr window_tree_client) override; | |
| 43 | |
| 44 private: | |
| 45 friend class test::WindowManagerWindowTreeFactorySetTestApi; | |
| 46 | |
| 47 // Used by tests. | |
| 48 WindowManagerWindowTreeFactory(WindowManagerWindowTreeFactorySet* registry, | |
| 49 const UserId& user_id); | |
| 50 | |
| 51 WindowServer* GetWindowServer(); | |
| 52 | |
| 53 void SetWindowTree(WindowTree* window_tree); | |
| 54 | |
| 55 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set_; | |
| 56 const UserId user_id_; | |
| 57 mojo::Binding<mojom::WindowManagerWindowTreeFactory> binding_; | |
| 58 | |
| 59 // Owned by WindowServer. | |
| 60 WindowTree* window_tree_; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(WindowManagerWindowTreeFactory); | |
| 63 }; | |
| 64 | |
| 65 } // namespace ws | |
| 66 } // namespace mus | |
| 67 | |
| 68 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_WINDOW_TREE_FACTORY_H_ | |
| OLD | NEW |