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/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/wm/public/interfaces/user_window_controller.mojom.h" | 20 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" |
21 #include "mojo/common/weak_binding_set.h" | 21 #include "mojo/common/weak_binding_set.h" |
22 #include "mojo/public/cpp/bindings/binding.h" | 22 #include "mojo/public/cpp/bindings/binding.h" |
23 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 23 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
24 #include "mojo/shell/public/cpp/application_delegate.h" | 24 #include "mojo/shell/public/cpp/shell_client.h" |
25 | 25 |
26 namespace ui { | 26 namespace ui { |
27 namespace mojo { | 27 namespace mojo { |
28 class UIInit; | 28 class UIInit; |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
32 namespace views { | 32 namespace views { |
33 class AuraInit; | 33 class AuraInit; |
34 } | 34 } |
35 | 35 |
36 namespace mash { | 36 namespace mash { |
37 namespace wm { | 37 namespace wm { |
38 | 38 |
39 class AcceleratorRegistrarImpl; | 39 class AcceleratorRegistrarImpl; |
40 class RootWindowController; | 40 class RootWindowController; |
41 class RootWindowsObserver; | 41 class RootWindowsObserver; |
42 class UserWindowControllerImpl; | 42 class UserWindowControllerImpl; |
43 | 43 |
44 class WindowManagerApplication | 44 class WindowManagerApplication |
45 : public mojo::ApplicationDelegate, | 45 : public mojo::ShellClient, |
46 public mus::mojom::WindowManagerFactory, | 46 public mus::mojom::WindowManagerFactory, |
47 public mojo::InterfaceFactory<mash::wm::mojom::UserWindowController>, | 47 public mojo::InterfaceFactory<mash::wm::mojom::UserWindowController>, |
48 public mojo::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { | 48 public mojo::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { |
49 public: | 49 public: |
50 WindowManagerApplication(); | 50 WindowManagerApplication(); |
51 ~WindowManagerApplication() override; | 51 ~WindowManagerApplication() override; |
52 | 52 |
53 mojo::Shell* shell() { return shell_; } | 53 mojo::Shell* shell() { return shell_; } |
54 | 54 |
55 // Returns the RootWindowControllers that have valid roots. | 55 // Returns the RootWindowControllers that have valid roots. |
(...skipping 14 matching lines...) Expand all Loading... |
70 | 70 |
71 // TODO(sky): figure out right place for this code. | 71 // TODO(sky): figure out right place for this code. |
72 void OnAccelerator(uint32_t id, mus::mojom::EventPtr event); | 72 void OnAccelerator(uint32_t id, mus::mojom::EventPtr event); |
73 | 73 |
74 void AddRootWindowsObserver(RootWindowsObserver* observer); | 74 void AddRootWindowsObserver(RootWindowsObserver* observer); |
75 void RemoveRootWindowsObserver(RootWindowsObserver* observer); | 75 void RemoveRootWindowsObserver(RootWindowsObserver* observer); |
76 | 76 |
77 private: | 77 private: |
78 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); | 78 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); |
79 | 79 |
80 // ApplicationDelegate: | 80 // mojo::ShellClient: |
81 void Initialize(mojo::Shell* shell, const std::string& url, | 81 void Initialize(mojo::Shell* shell, const std::string& url, |
82 uint32_t id) override; | 82 uint32_t id) override; |
83 bool AcceptConnection( | 83 bool AcceptConnection(mojo::Connection* connection) override; |
84 mojo::ApplicationConnection* connection) override; | |
85 | 84 |
86 // InterfaceFactory<mash::wm::mojom::UserWindowController>: | 85 // InterfaceFactory<mash::wm::mojom::UserWindowController>: |
87 void Create(mojo::ApplicationConnection* connection, | 86 void Create(mojo::Connection* connection, |
88 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> | 87 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> |
89 request) override; | 88 request) override; |
90 | 89 |
91 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>: | 90 // InterfaceFactory<mus::mojom::AcceleratorRegistrar>: |
92 void Create(mojo::ApplicationConnection* connection, | 91 void Create(mojo::Connection* connection, |
93 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) | 92 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) |
94 override; | 93 override; |
95 | 94 |
96 // mus::mojom::WindowManagerFactory: | 95 // mus::mojom::WindowManagerFactory: |
97 void CreateWindowManager(mus::mojom::DisplayPtr display, | 96 void CreateWindowManager(mus::mojom::DisplayPtr display, |
98 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> | 97 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> |
99 client_request) override; | 98 client_request) override; |
100 | 99 |
101 mojo::Shell* shell_; | 100 mojo::Shell* shell_; |
102 | 101 |
(...skipping 19 matching lines...) Expand all Loading... |
122 | 121 |
123 base::ObserverList<RootWindowsObserver> root_windows_observers_; | 122 base::ObserverList<RootWindowsObserver> root_windows_observers_; |
124 | 123 |
125 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 124 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
126 }; | 125 }; |
127 | 126 |
128 } // namespace wm | 127 } // namespace wm |
129 } // namespace mash | 128 } // namespace mash |
130 | 129 |
131 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 130 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ |
OLD | NEW |