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 ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 5 #ifndef ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ |
6 #define ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 6 #define ASH_MUS_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 "ash/public/interfaces/shelf.mojom.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "mash/session/public/interfaces/session.mojom.h" | 15 #include "mash/session/public/interfaces/session.mojom.h" |
15 #include "mojo/public/cpp/bindings/binding.h" | 16 #include "mojo/public/cpp/bindings/binding.h" |
16 #include "mojo/public/cpp/bindings/binding_set.h" | 17 #include "mojo/public/cpp/bindings/binding_set.h" |
17 #include "services/shell/public/cpp/service.h" | 18 #include "services/shell/public/cpp/service.h" |
18 #include "services/tracing/public/cpp/provider.h" | 19 #include "services/tracing/public/cpp/provider.h" |
19 #include "services/ui/common/types.h" | 20 #include "services/ui/common/types.h" |
20 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" | 21 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" |
21 | 22 |
22 namespace views { | 23 namespace views { |
23 class AuraInit; | 24 class AuraInit; |
24 class SurfaceContextFactory; | 25 class SurfaceContextFactory; |
25 } | 26 } |
26 | 27 |
27 namespace ui { | 28 namespace ui { |
28 class Event; | 29 class Event; |
29 class GpuService; | 30 class GpuService; |
30 class WindowTreeClient; | 31 class WindowTreeClient; |
31 } | 32 } |
32 | 33 |
33 namespace ash { | 34 namespace ash { |
34 namespace mus { | 35 namespace mus { |
35 | 36 |
36 class AcceleratorRegistrarImpl; | 37 class AcceleratorRegistrarImpl; |
37 class NativeWidgetFactoryMus; | 38 class NativeWidgetFactoryMus; |
38 class WindowManager; | 39 class WindowManager; |
39 | 40 |
40 // Hosts the window manager and the ash system user interface for mash. | 41 // Hosts the window manager and the ash system user interface for mash. |
41 // TODO(mash): Port ash_sysui's ShelfController and WallpaperController here. | 42 // TODO(mash): Port ash_sysui's WallpaperController here. |
42 class WindowManagerApplication | 43 class WindowManagerApplication |
43 : public shell::Service, | 44 : public shell::Service, |
| 45 public shell::InterfaceFactory<ash::mojom::ShelfController>, |
44 public shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>, | 46 public shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>, |
45 public mash::session::mojom::ScreenlockStateListener { | 47 public mash::session::mojom::ScreenlockStateListener { |
46 public: | 48 public: |
47 WindowManagerApplication(); | 49 WindowManagerApplication(); |
48 ~WindowManagerApplication() override; | 50 ~WindowManagerApplication() override; |
49 | 51 |
50 WindowManager* window_manager() { return window_manager_.get(); } | 52 WindowManager* window_manager() { return window_manager_.get(); } |
51 | 53 |
52 mash::session::mojom::Session* session() { return session_.get(); } | 54 mash::session::mojom::Session* session() { return session_.get(); } |
53 | 55 |
54 private: | 56 private: |
55 friend class WmTestBase; | 57 friend class WmTestBase; |
56 friend class WmTestHelper; | 58 friend class WmTestHelper; |
57 | 59 |
58 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); | 60 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); |
59 | 61 |
60 void InitWindowManager(ui::WindowTreeClient* window_tree_client); | 62 void InitWindowManager(ui::WindowTreeClient* window_tree_client); |
61 | 63 |
62 // shell::Service: | 64 // shell::Service: |
63 void OnStart(const shell::Identity& identity) override; | 65 void OnStart(const shell::Identity& identity) override; |
64 bool OnConnect(const shell::Identity& remote_identity, | 66 bool OnConnect(const shell::Identity& remote_identity, |
65 shell::InterfaceRegistry* registry) override; | 67 shell::InterfaceRegistry* registry) override; |
66 | 68 |
| 69 // InterfaceFactory<ash::mojom::ShelfController>: |
| 70 void Create(const shell::Identity& remote_identity, |
| 71 ash::mojom::ShelfControllerRequest request) override; |
| 72 |
67 // shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>: | 73 // shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>: |
68 void Create( | 74 void Create(const shell::Identity& remote_identity, |
69 const shell::Identity& remote_identity, | 75 ui::mojom::AcceleratorRegistrarRequest request) override; |
70 mojo::InterfaceRequest<ui::mojom::AcceleratorRegistrar> request) override; | |
71 | 76 |
72 // session::mojom::ScreenlockStateListener: | 77 // session::mojom::ScreenlockStateListener: |
73 void ScreenlockStateChanged(bool locked) override; | 78 void ScreenlockStateChanged(bool locked) override; |
74 | 79 |
75 tracing::Provider tracing_; | 80 tracing::Provider tracing_; |
76 | 81 |
77 std::unique_ptr<views::AuraInit> aura_init_; | 82 std::unique_ptr<views::AuraInit> aura_init_; |
78 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_; | 83 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_; |
79 | 84 |
80 std::unique_ptr<ui::GpuService> gpu_service_; | 85 std::unique_ptr<ui::GpuService> gpu_service_; |
81 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_; | 86 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_; |
82 std::unique_ptr<WindowManager> window_manager_; | 87 std::unique_ptr<WindowManager> window_manager_; |
83 | 88 |
| 89 mojo::BindingSet<ash::mojom::ShelfController> shelf_controller_bindings_; |
| 90 |
84 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; | 91 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; |
85 | 92 |
86 mash::session::mojom::SessionPtr session_; | 93 mash::session::mojom::SessionPtr session_; |
87 | 94 |
88 mojo::Binding<mash::session::mojom::ScreenlockStateListener> | 95 mojo::Binding<mash::session::mojom::ScreenlockStateListener> |
89 screenlock_state_listener_binding_; | 96 screenlock_state_listener_binding_; |
90 | 97 |
91 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 98 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
92 }; | 99 }; |
93 | 100 |
94 } // namespace mus | 101 } // namespace mus |
95 } // namespace ash | 102 } // namespace ash |
96 | 103 |
97 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 104 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ |
OLD | NEW |