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