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/window_manager.mojom.h" | 19 #include "components/mus/public/interfaces/window_manager.mojom.h" |
20 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 20 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
21 #include "mash/wm/public/interfaces/container.mojom.h" | 21 #include "mash/wm/public/interfaces/container.mojom.h" |
22 #include "mash/wm/public/interfaces/user_window_controller.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 { |
29 class UIInit; | 30 class UIInit; |
30 } | 31 } |
31 } | 32 } |
32 | 33 |
33 namespace views { | 34 namespace views { |
34 class AuraInit; | 35 class AuraInit; |
35 } | 36 } |
36 | 37 |
37 namespace mash { | 38 namespace mash { |
38 namespace wm { | 39 namespace wm { |
39 | 40 |
40 class AcceleratorRegistrarImpl; | 41 class AcceleratorRegistrarImpl; |
41 class BackgroundLayout; | 42 class BackgroundLayout; |
42 class ShadowController; | 43 class ShadowController; |
43 class ShelfLayout; | 44 class ShelfLayout; |
45 class UserWindowControllerImpl; | |
44 class WindowLayout; | 46 class WindowLayout; |
45 class WindowManagerImpl; | 47 class WindowManagerImpl; |
46 | 48 |
47 class WindowManagerApplication | 49 class WindowManagerApplication |
48 : public mojo::ApplicationDelegate, | 50 : public mojo::ApplicationDelegate, |
49 public mus::WindowObserver, | 51 public mus::WindowObserver, |
50 public mus::mojom::WindowTreeHostClient, | 52 public mus::mojom::WindowTreeHostClient, |
51 public mus::WindowTreeDelegate, | 53 public mus::WindowTreeDelegate, |
54 public mojo::InterfaceFactory<mash::wm::mojom::UserWindowController>, | |
52 public mojo::InterfaceFactory<mus::mojom::WindowManager>, | 55 public mojo::InterfaceFactory<mus::mojom::WindowManager>, |
53 public mojo::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { | 56 public mojo::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { |
54 public: | 57 public: |
55 WindowManagerApplication(); | 58 WindowManagerApplication(); |
56 ~WindowManagerApplication() override; | 59 ~WindowManagerApplication() override; |
57 | 60 |
58 mus::Window* root() { return root_; } | 61 mus::Window* root() { return root_; } |
59 | 62 |
60 int window_count() { return window_count_; } | 63 int window_count() { return window_count_; } |
61 void IncrementWindowCount() { ++window_count_; } | 64 void IncrementWindowCount() { ++window_count_; } |
(...skipping 17 matching lines...) Expand all Loading... | |
79 bool ConfigureIncomingConnection( | 82 bool ConfigureIncomingConnection( |
80 mojo::ApplicationConnection* connection) override; | 83 mojo::ApplicationConnection* connection) override; |
81 | 84 |
82 // WindowTreeHostClient: | 85 // WindowTreeHostClient: |
83 void OnAccelerator(uint32_t id, mus::mojom::EventPtr event) override; | 86 void OnAccelerator(uint32_t id, mus::mojom::EventPtr event) override; |
84 | 87 |
85 // WindowTreeDelegate: | 88 // WindowTreeDelegate: |
86 void OnEmbed(mus::Window* root) override; | 89 void OnEmbed(mus::Window* root) override; |
87 void OnConnectionLost(mus::WindowTreeConnection* connection) override; | 90 void OnConnectionLost(mus::WindowTreeConnection* connection) override; |
88 | 91 |
92 // InterfaceFactory<mash::wm::mojom::UserWindowController>: | |
93 void Create( | |
94 mojo::ApplicationConnection* connection, | |
95 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) | |
96 override; | |
97 | |
89 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>: | 98 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>: |
90 void Create(mojo::ApplicationConnection* connection, | 99 void Create(mojo::ApplicationConnection* connection, |
91 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) | 100 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) |
92 override; | 101 override; |
93 | 102 |
94 // InterfaceFactory<mus::mojom::WindowManager>: | 103 // InterfaceFactory<mus::mojom::WindowManager>: |
95 void Create( | 104 void Create( |
96 mojo::ApplicationConnection* connection, | 105 mojo::ApplicationConnection* connection, |
97 mojo::InterfaceRequest<mus::mojom::WindowManager> request) override; | 106 mojo::InterfaceRequest<mus::mojom::WindowManager> request) override; |
98 | 107 |
(...skipping 16 matching lines...) Expand all Loading... | |
115 | 124 |
116 scoped_ptr<ui::mojo::UIInit> ui_init_; | 125 scoped_ptr<ui::mojo::UIInit> ui_init_; |
117 scoped_ptr<views::AuraInit> aura_init_; | 126 scoped_ptr<views::AuraInit> aura_init_; |
118 | 127 |
119 // |window_manager_| is created once OnEmbed() is called. Until that time | 128 // |window_manager_| is created once OnEmbed() is called. Until that time |
120 // |requests_| stores any pending WindowManager interface requests. | 129 // |requests_| stores any pending WindowManager interface requests. |
121 scoped_ptr<WindowManagerImpl> window_manager_; | 130 scoped_ptr<WindowManagerImpl> window_manager_; |
122 mojo::WeakBindingSet<mus::mojom::WindowManager> window_manager_binding_; | 131 mojo::WeakBindingSet<mus::mojom::WindowManager> window_manager_binding_; |
123 ScopedVector<mojo::InterfaceRequest<mus::mojom::WindowManager>> requests_; | 132 ScopedVector<mojo::InterfaceRequest<mus::mojom::WindowManager>> requests_; |
124 | 133 |
134 // |user_window_controller_| is created once OnEmbed() is called. Until that | |
135 // time |user_window_controller_requests_| stores pending interface requests. | |
136 scoped_ptr<UserWindowControllerImpl> user_window_controller_; | |
137 mojo::WeakBindingSet<mash::wm::mojom::UserWindowController> | |
138 user_window_controller_binding_; | |
139 ScopedVector<mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>> | |
sky
2016/01/14 00:19:21
ScopedVector is deprecated. See the header.
| |
140 user_window_controller_requests_; | |
141 | |
125 scoped_ptr<BackgroundLayout> background_layout_; | 142 scoped_ptr<BackgroundLayout> background_layout_; |
126 scoped_ptr<ShelfLayout> shelf_layout_; | 143 scoped_ptr<ShelfLayout> shelf_layout_; |
127 scoped_ptr<WindowLayout> window_layout_; | 144 scoped_ptr<WindowLayout> window_layout_; |
128 | 145 |
129 scoped_ptr<ShadowController> shadow_controller_; | 146 scoped_ptr<ShadowController> shadow_controller_; |
130 | 147 |
131 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; | 148 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; |
132 | 149 |
133 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 150 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
134 }; | 151 }; |
135 | 152 |
136 } // namespace wm | 153 } // namespace wm |
137 } // namespace mash | 154 } // namespace mash |
138 | 155 |
139 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 156 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ |
OLD | NEW |