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 <set> | 10 #include <set> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
15 #include "components/mus/common/types.h" | 15 #include "components/mus/common/types.h" |
16 #include "components/mus/public/cpp/window_observer.h" | 16 #include "components/mus/public/cpp/window_observer.h" |
17 #include "components/mus/public/cpp/window_tree_delegate.h" | 17 #include "components/mus/public/cpp/window_tree_delegate.h" |
18 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" | 18 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" |
| 19 #include "components/mus/public/interfaces/user_window_controller.mojom.h" |
19 #include "components/mus/public/interfaces/window_manager.mojom.h" | 20 #include "components/mus/public/interfaces/window_manager.mojom.h" |
20 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 21 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
21 #include "mash/wm/public/interfaces/container.mojom.h" | 22 #include "mash/wm/public/interfaces/container.mojom.h" |
22 #include "mojo/common/weak_binding_set.h" | 23 #include "mojo/common/weak_binding_set.h" |
23 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 24 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
24 #include "mojo/shell/public/cpp/application_delegate.h" | 25 #include "mojo/shell/public/cpp/application_delegate.h" |
25 #include "mojo/shell/public/cpp/interface_factory_impl.h" | 26 #include "mojo/shell/public/cpp/interface_factory_impl.h" |
26 | 27 |
27 namespace ui { | 28 namespace ui { |
28 namespace mojo { | 29 namespace mojo { |
(...skipping 14 matching lines...) Expand all Loading... |
43 class ShelfLayout; | 44 class ShelfLayout; |
44 class WindowLayout; | 45 class WindowLayout; |
45 class WindowManagerImpl; | 46 class WindowManagerImpl; |
46 | 47 |
47 class WindowManagerApplication | 48 class WindowManagerApplication |
48 : public mojo::ApplicationDelegate, | 49 : public mojo::ApplicationDelegate, |
49 public mus::WindowObserver, | 50 public mus::WindowObserver, |
50 public mus::mojom::WindowTreeHostClient, | 51 public mus::mojom::WindowTreeHostClient, |
51 public mus::WindowTreeDelegate, | 52 public mus::WindowTreeDelegate, |
52 public mojo::InterfaceFactory<mus::mojom::WindowManager>, | 53 public mojo::InterfaceFactory<mus::mojom::WindowManager>, |
| 54 public mojo::InterfaceFactory<mus::mojom::UserWindowController>, |
53 public mojo::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { | 55 public mojo::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { |
54 public: | 56 public: |
55 WindowManagerApplication(); | 57 WindowManagerApplication(); |
56 ~WindowManagerApplication() override; | 58 ~WindowManagerApplication() override; |
57 | 59 |
58 mus::Window* root() { return root_; } | 60 mus::Window* root() { return root_; } |
59 | 61 |
60 int window_count() { return window_count_; } | 62 int window_count() { return window_count_; } |
61 void IncrementWindowCount() { ++window_count_; } | 63 void IncrementWindowCount() { ++window_count_; } |
62 | 64 |
(...skipping 26 matching lines...) Expand all Loading... |
89 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>: | 91 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>: |
90 void Create(mojo::ApplicationConnection* connection, | 92 void Create(mojo::ApplicationConnection* connection, |
91 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) | 93 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) |
92 override; | 94 override; |
93 | 95 |
94 // InterfaceFactory<mus::mojom::WindowManager>: | 96 // InterfaceFactory<mus::mojom::WindowManager>: |
95 void Create( | 97 void Create( |
96 mojo::ApplicationConnection* connection, | 98 mojo::ApplicationConnection* connection, |
97 mojo::InterfaceRequest<mus::mojom::WindowManager> request) override; | 99 mojo::InterfaceRequest<mus::mojom::WindowManager> request) override; |
98 | 100 |
| 101 // InterfaceFactory<mus::mojom::UserWindowController>: |
| 102 void Create( |
| 103 mojo::ApplicationConnection* connection, |
| 104 mojo::InterfaceRequest<mus::mojom::UserWindowController> request) |
| 105 override; |
| 106 |
99 // mus::WindowObserver: | 107 // mus::WindowObserver: |
100 void OnWindowDestroyed(mus::Window* window) override; | 108 void OnWindowDestroyed(mus::Window* window) override; |
101 | 109 |
102 // Sets up the window containers used for z-space management. | 110 // Sets up the window containers used for z-space management. |
103 void CreateContainers(); | 111 void CreateContainers(); |
104 | 112 |
105 // nullptr until the Mus connection is established via OnEmbed(). | 113 // nullptr until the Mus connection is established via OnEmbed(). |
106 mus::Window* root_; | 114 mus::Window* root_; |
107 int window_count_; | 115 int window_count_; |
108 | 116 |
109 mojo::ApplicationImpl* app_; | 117 mojo::ApplicationImpl* app_; |
110 | 118 |
111 mojo::TracingImpl tracing_; | 119 mojo::TracingImpl tracing_; |
112 | 120 |
113 mus::mojom::WindowTreeHostPtr window_tree_host_; | 121 mus::mojom::WindowTreeHostPtr window_tree_host_; |
114 mojo::Binding<mus::mojom::WindowTreeHostClient> host_client_binding_; | 122 mojo::Binding<mus::mojom::WindowTreeHostClient> host_client_binding_; |
115 | 123 |
116 scoped_ptr<ui::mojo::UIInit> ui_init_; | 124 scoped_ptr<ui::mojo::UIInit> ui_init_; |
117 scoped_ptr<views::AuraInit> aura_init_; | 125 scoped_ptr<views::AuraInit> aura_init_; |
118 | 126 |
119 // |window_manager_| is created once OnEmbed() is called. Until that time | 127 // |window_manager_| is created once OnEmbed() is called. Until that time |
120 // |requests_| stores any pending WindowManager interface requests. | 128 // |requests_| stores any pending WindowManager interface requests. |
121 scoped_ptr<WindowManagerImpl> window_manager_; | 129 scoped_ptr<WindowManagerImpl> window_manager_; |
122 mojo::WeakBindingSet<mus::mojom::WindowManager> window_manager_binding_; | 130 mojo::WeakBindingSet<mus::mojom::WindowManager> window_manager_binding_; |
123 ScopedVector<mojo::InterfaceRequest<mus::mojom::WindowManager>> requests_; | 131 ScopedVector<mojo::InterfaceRequest<mus::mojom::WindowManager>> requests_; |
| 132 mojo::WeakBindingSet<mus::mojom::UserWindowController> |
| 133 user_window_controller_binding_; |
| 134 ScopedVector<mojo::InterfaceRequest<mus::mojom::UserWindowController>> |
| 135 user_window_controller_requests_; |
| 136 |
124 | 137 |
125 scoped_ptr<BackgroundLayout> background_layout_; | 138 scoped_ptr<BackgroundLayout> background_layout_; |
126 scoped_ptr<ShelfLayout> shelf_layout_; | 139 scoped_ptr<ShelfLayout> shelf_layout_; |
127 scoped_ptr<WindowLayout> window_layout_; | 140 scoped_ptr<WindowLayout> window_layout_; |
128 | 141 |
129 scoped_ptr<ShadowController> shadow_controller_; | 142 scoped_ptr<ShadowController> shadow_controller_; |
130 | 143 |
131 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; | 144 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; |
132 | 145 |
133 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 146 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
134 }; | 147 }; |
135 | 148 |
136 } // namespace wm | 149 } // namespace wm |
137 } // namespace mash | 150 } // namespace mash |
138 | 151 |
139 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 152 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ |
OLD | NEW |