OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 5 #ifndef MASH_WM_WINDOW_MANAGER_APPLICATION_H_ |
6 #define MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 6 #define MASH_WM_WINDOW_MANAGER_APPLICATION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <set> | 11 #include <set> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "components/mus/common/types.h" | 15 #include "components/mus/common/types.h" |
16 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" | 16 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" |
17 #include "components/mus/public/interfaces/window_manager.mojom.h" | 17 #include "components/mus/public/interfaces/window_manager.mojom.h" |
18 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" | 18 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" |
19 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 19 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
20 #include "mash/session/public/interfaces/session.mojom.h" | 20 #include "mash/session/public/interfaces/session.mojom.h" |
| 21 #include "mash/wm/public/interfaces/shelf_layout.mojom.h" |
21 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" | 22 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" |
22 #include "mojo/public/cpp/bindings/binding.h" | 23 #include "mojo/public/cpp/bindings/binding.h" |
23 #include "mojo/public/cpp/bindings/binding_set.h" | 24 #include "mojo/public/cpp/bindings/binding_set.h" |
24 #include "services/shell/public/cpp/shell_client.h" | 25 #include "services/shell/public/cpp/shell_client.h" |
25 #include "services/tracing/public/cpp/tracing_impl.h" | 26 #include "services/tracing/public/cpp/tracing_impl.h" |
26 | 27 |
27 namespace ui { | 28 namespace ui { |
28 namespace mojo { | 29 namespace mojo { |
29 class UIInit; | 30 class UIInit; |
30 } | 31 } |
(...skipping 11 matching lines...) Expand all Loading... |
42 namespace wm { | 43 namespace wm { |
43 | 44 |
44 class AcceleratorRegistrarImpl; | 45 class AcceleratorRegistrarImpl; |
45 class RootWindowController; | 46 class RootWindowController; |
46 class RootWindowsObserver; | 47 class RootWindowsObserver; |
47 class UserWindowControllerImpl; | 48 class UserWindowControllerImpl; |
48 | 49 |
49 class WindowManagerApplication | 50 class WindowManagerApplication |
50 : public shell::ShellClient, | 51 : public shell::ShellClient, |
51 public mus::mojom::WindowManagerFactory, | 52 public mus::mojom::WindowManagerFactory, |
52 public shell::InterfaceFactory<mash::wm::mojom::UserWindowController>, | 53 public shell::InterfaceFactory<mojom::ShelfLayout>, |
| 54 public shell::InterfaceFactory<mojom::UserWindowController>, |
53 public shell::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { | 55 public shell::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { |
54 public: | 56 public: |
55 WindowManagerApplication(); | 57 WindowManagerApplication(); |
56 ~WindowManagerApplication() override; | 58 ~WindowManagerApplication() override; |
57 | 59 |
58 shell::Connector* connector() { return connector_; } | 60 shell::Connector* connector() { return connector_; } |
59 | 61 |
60 // Returns the RootWindowControllers that have valid roots. | 62 // Returns the RootWindowControllers that have valid roots. |
61 // | 63 // |
62 // NOTE: this does not return |controllers_| as most clients want a | 64 // NOTE: this does not return |controllers_| as most clients want a |
(...skipping 22 matching lines...) Expand all Loading... |
85 | 87 |
86 private: | 88 private: |
87 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); | 89 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); |
88 | 90 |
89 // shell::ShellClient: | 91 // shell::ShellClient: |
90 void Initialize(shell::Connector* connector, | 92 void Initialize(shell::Connector* connector, |
91 const shell::Identity& identity, | 93 const shell::Identity& identity, |
92 uint32_t id) override; | 94 uint32_t id) override; |
93 bool AcceptConnection(shell::Connection* connection) override; | 95 bool AcceptConnection(shell::Connection* connection) override; |
94 | 96 |
95 // InterfaceFactory<mash::wm::mojom::UserWindowController>: | 97 // shell::InterfaceFactory<mojom::ShelfLayout>: |
96 void Create(shell::Connection* connection, | 98 void Create(shell::Connection* connection, |
97 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> | 99 mojo::InterfaceRequest<mojom::ShelfLayout> request) override; |
98 request) override; | |
99 | 100 |
100 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>: | 101 // shell::InterfaceFactory<mojom::UserWindowController>: |
| 102 void Create( |
| 103 shell::Connection* connection, |
| 104 mojo::InterfaceRequest<mojom::UserWindowController> request) override; |
| 105 |
| 106 // shell::InterfaceFactory<mus::mojom::AcceleratorRegistrar>: |
101 void Create(shell::Connection* connection, | 107 void Create(shell::Connection* connection, |
102 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) | 108 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) |
103 override; | 109 override; |
104 | 110 |
105 // mus::mojom::WindowManagerFactory: | 111 // mus::mojom::WindowManagerFactory: |
106 void CreateWindowManager(mus::mojom::DisplayPtr display, | 112 void CreateWindowManager(mus::mojom::DisplayPtr display, |
107 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> | 113 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> |
108 client_request) override; | 114 client_request) override; |
109 | 115 |
110 shell::Connector* connector_; | 116 shell::Connector* connector_; |
111 | 117 |
112 mojo::TracingImpl tracing_; | 118 mojo::TracingImpl tracing_; |
113 | 119 |
114 std::unique_ptr<ui::mojo::UIInit> ui_init_; | 120 std::unique_ptr<ui::mojo::UIInit> ui_init_; |
115 std::unique_ptr<views::AuraInit> aura_init_; | 121 std::unique_ptr<views::AuraInit> aura_init_; |
116 | 122 |
| 123 // The ShelfLayout object is created once OnEmbed() is called. Until that |
| 124 // time |shelf_layout_requests_| stores pending interface requests. |
| 125 mojo::BindingSet<mojom::ShelfLayout> shelf_layout_bindings_; |
| 126 std::vector<scoped_ptr<mojo::InterfaceRequest<mojom::ShelfLayout>>> |
| 127 shelf_layout_requests_; |
| 128 |
117 // |user_window_controller_| is created once OnEmbed() is called. Until that | 129 // |user_window_controller_| is created once OnEmbed() is called. Until that |
118 // time |user_window_controller_requests_| stores pending interface requests. | 130 // time |user_window_controller_requests_| stores pending interface requests. |
119 std::unique_ptr<UserWindowControllerImpl> user_window_controller_; | 131 std::unique_ptr<UserWindowControllerImpl> user_window_controller_; |
120 mojo::BindingSet<mash::wm::mojom::UserWindowController> | 132 mojo::BindingSet<mojom::UserWindowController> |
121 user_window_controller_binding_; | 133 user_window_controller_bindings_; |
122 std::vector<std::unique_ptr< | 134 std::vector< |
123 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>>> | 135 std::unique_ptr<mojo::InterfaceRequest<mojom::UserWindowController>>> |
124 user_window_controller_requests_; | 136 user_window_controller_requests_; |
125 | 137 |
126 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; | 138 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; |
127 std::set<RootWindowController*> root_controllers_; | 139 std::set<RootWindowController*> root_controllers_; |
128 | 140 |
129 mojo::Binding<mus::mojom::WindowManagerFactory> | 141 mojo::Binding<mus::mojom::WindowManagerFactory> |
130 window_manager_factory_binding_; | 142 window_manager_factory_binding_; |
131 | 143 |
132 mash::session::mojom::SessionPtr session_; | 144 mash::session::mojom::SessionPtr session_; |
133 | 145 |
134 base::ObserverList<RootWindowsObserver> root_windows_observers_; | 146 base::ObserverList<RootWindowsObserver> root_windows_observers_; |
135 | 147 |
136 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 148 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
137 }; | 149 }; |
138 | 150 |
139 } // namespace wm | 151 } // namespace wm |
140 } // namespace mash | 152 } // namespace mash |
141 | 153 |
142 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 154 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ |
OLD | NEW |