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/mus/window_manager_observer.h" | 13 #include "ash/mus/window_manager_observer.h" |
14 #include "ash/public/interfaces/shelf_layout.mojom.h" | 14 #include "ash/public/interfaces/shelf_layout.mojom.h" |
15 #include "ash/public/interfaces/user_window_controller.mojom.h" | 15 #include "ash/public/interfaces/user_window_controller.mojom.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "mash/session/public/interfaces/session.mojom.h" | 17 #include "mash/session/public/interfaces/session.mojom.h" |
18 #include "mojo/public/cpp/bindings/binding.h" | 18 #include "mojo/public/cpp/bindings/binding.h" |
19 #include "mojo/public/cpp/bindings/binding_set.h" | 19 #include "mojo/public/cpp/bindings/binding_set.h" |
20 #include "services/shell/public/cpp/shell_client.h" | 20 #include "services/shell/public/cpp/service.h" |
21 #include "services/tracing/public/cpp/tracing_impl.h" | 21 #include "services/tracing/public/cpp/tracing_impl.h" |
22 #include "services/ui/common/types.h" | 22 #include "services/ui/common/types.h" |
23 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" | 23 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" |
24 | 24 |
25 namespace views { | 25 namespace views { |
26 class AuraInit; | 26 class AuraInit; |
27 } | 27 } |
28 | 28 |
29 namespace ui { | 29 namespace ui { |
30 class Event; | 30 class Event; |
31 class WindowTreeClient; | 31 class WindowTreeClient; |
32 } | 32 } |
33 | 33 |
34 namespace ash { | 34 namespace ash { |
35 namespace mus { | 35 namespace mus { |
36 | 36 |
37 class AcceleratorRegistrarImpl; | 37 class AcceleratorRegistrarImpl; |
38 class RootWindowController; | 38 class RootWindowController; |
39 class ShelfLayoutImpl; | 39 class ShelfLayoutImpl; |
40 class UserWindowControllerImpl; | 40 class UserWindowControllerImpl; |
41 class WindowManager; | 41 class WindowManager; |
42 | 42 |
43 class WindowManagerApplication | 43 class WindowManagerApplication |
44 : public shell::ShellClient, | 44 : public shell::Service, |
45 public shell::InterfaceFactory<mojom::ShelfLayout>, | 45 public shell::InterfaceFactory<mojom::ShelfLayout>, |
46 public shell::InterfaceFactory<mojom::UserWindowController>, | 46 public shell::InterfaceFactory<mojom::UserWindowController>, |
47 public shell::InterfaceFactory<::ui::mojom::AcceleratorRegistrar>, | 47 public shell::InterfaceFactory<::ui::mojom::AcceleratorRegistrar>, |
48 public mash::session::mojom::ScreenlockStateListener, | 48 public mash::session::mojom::ScreenlockStateListener, |
49 public WindowManagerObserver { | 49 public WindowManagerObserver { |
50 public: | 50 public: |
51 WindowManagerApplication(); | 51 WindowManagerApplication(); |
52 ~WindowManagerApplication() override; | 52 ~WindowManagerApplication() override; |
53 | 53 |
54 shell::Connector* connector() { return connector_; } | 54 shell::Connector* connector() { return connector_; } |
55 | 55 |
56 WindowManager* window_manager() { return window_manager_.get(); } | 56 WindowManager* window_manager() { return window_manager_.get(); } |
57 | 57 |
58 mash::session::mojom::Session* session() { return session_.get(); } | 58 mash::session::mojom::Session* session() { return session_.get(); } |
59 | 59 |
60 private: | 60 private: |
61 friend class WmTestBase; | 61 friend class WmTestBase; |
62 friend class WmTestHelper; | 62 friend class WmTestHelper; |
63 | 63 |
64 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); | 64 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); |
65 | 65 |
66 void InitWindowManager(::ui::WindowTreeClient* window_tree_client); | 66 void InitWindowManager(::ui::WindowTreeClient* window_tree_client); |
67 | 67 |
68 // shell::ShellClient: | 68 // shell::Service: |
69 void Initialize(shell::Connector* connector, | 69 void OnStart(shell::Connector* connector, |
70 const shell::Identity& identity, | 70 const shell::Identity& identity, |
71 uint32_t id) override; | 71 uint32_t id) override; |
72 bool AcceptConnection(shell::Connection* connection) override; | 72 bool OnConnect(shell::Connection* connection) override; |
73 | 73 |
74 // shell::InterfaceFactory<mojom::ShelfLayout>: | 74 // shell::InterfaceFactory<mojom::ShelfLayout>: |
75 void Create(shell::Connection* connection, | 75 void Create(shell::Connection* connection, |
76 mojo::InterfaceRequest<mojom::ShelfLayout> request) override; | 76 mojo::InterfaceRequest<mojom::ShelfLayout> request) override; |
77 | 77 |
78 // shell::InterfaceFactory<mojom::UserWindowController>: | 78 // shell::InterfaceFactory<mojom::UserWindowController>: |
79 void Create( | 79 void Create( |
80 shell::Connection* connection, | 80 shell::Connection* connection, |
81 mojo::InterfaceRequest<mojom::UserWindowController> request) override; | 81 mojo::InterfaceRequest<mojom::UserWindowController> request) override; |
82 | 82 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 mojo::Binding<mash::session::mojom::ScreenlockStateListener> | 123 mojo::Binding<mash::session::mojom::ScreenlockStateListener> |
124 screenlock_state_listener_binding_; | 124 screenlock_state_listener_binding_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 126 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace mus | 129 } // namespace mus |
130 } // namespace ash | 130 } // namespace ash |
131 | 131 |
132 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 132 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ |
OLD | NEW |