OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ROOT_WINDOW_CONTROLLER_H_ | 5 #ifndef MASH_WM_ROOT_WINDOW_CONTROLLER_H_ |
6 #define MASH_WM_ROOT_WINDOW_CONTROLLER_H_ | 6 #define MASH_WM_ROOT_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "components/mus/public/cpp/window_observer.h" | 10 #include "components/mus/public/cpp/window_observer.h" |
11 #include "components/mus/public/cpp/window_tree_delegate.h" | 11 #include "components/mus/public/cpp/window_tree_delegate.h" |
12 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" | 12 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" |
13 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 13 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
14 #include "mash/wm/public/interfaces/container.mojom.h" | 14 #include "mash/wm/public/interfaces/container.mojom.h" |
15 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
16 | 16 |
17 namespace mojo { | |
18 class Connector; | |
19 } | |
20 | |
21 namespace mus { | 17 namespace mus { |
22 class WindowManagerClient; | 18 class WindowManagerClient; |
23 } | 19 } |
24 | 20 |
| 21 namespace shell { |
| 22 class Connector; |
| 23 } |
| 24 |
25 namespace ui { | 25 namespace ui { |
26 class Event; | 26 class Event; |
27 } | 27 } |
28 | 28 |
29 namespace mash { | 29 namespace mash { |
30 namespace wm { | 30 namespace wm { |
31 | 31 |
32 class LayoutManager; | 32 class LayoutManager; |
33 class ShadowController; | 33 class ShadowController; |
34 class WindowManager; | 34 class WindowManager; |
35 class WindowManagerApplication; | 35 class WindowManagerApplication; |
36 | 36 |
37 // RootWindowController manages the windows and state for a single display. | 37 // RootWindowController manages the windows and state for a single display. |
38 // | 38 // |
39 // RootWindowController deletes itself when the root mus::Window is destroyed. | 39 // RootWindowController deletes itself when the root mus::Window is destroyed. |
40 // You can trigger deletion explicitly by way of Destroy(). | 40 // You can trigger deletion explicitly by way of Destroy(). |
41 class RootWindowController : public mus::WindowObserver, | 41 class RootWindowController : public mus::WindowObserver, |
42 public mus::WindowTreeDelegate { | 42 public mus::WindowTreeDelegate { |
43 public: | 43 public: |
44 static RootWindowController* CreateFromDisplay( | 44 static RootWindowController* CreateFromDisplay( |
45 WindowManagerApplication* app, | 45 WindowManagerApplication* app, |
46 mus::mojom::DisplayPtr display, | 46 mus::mojom::DisplayPtr display, |
47 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request); | 47 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request); |
48 | 48 |
49 // Deletes this. | 49 // Deletes this. |
50 void Destroy(); | 50 void Destroy(); |
51 | 51 |
52 mojo::Connector* GetConnector(); | 52 shell::Connector* GetConnector(); |
53 | 53 |
54 mus::Window* root() { return root_; } | 54 mus::Window* root() { return root_; } |
55 | 55 |
56 int window_count() { return window_count_; } | 56 int window_count() { return window_count_; } |
57 void IncrementWindowCount() { ++window_count_; } | 57 void IncrementWindowCount() { ++window_count_; } |
58 | 58 |
59 mus::Window* GetWindowForContainer(mojom::Container container); | 59 mus::Window* GetWindowForContainer(mojom::Container container); |
60 bool WindowIsContainer(const mus::Window* window) const; | 60 bool WindowIsContainer(const mus::Window* window) const; |
61 | 61 |
62 WindowManager* window_manager() { return window_manager_.get(); } | 62 WindowManager* window_manager() { return window_manager_.get(); } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 mus::mojom::DisplayPtr display_; | 96 mus::mojom::DisplayPtr display_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 98 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
99 }; | 99 }; |
100 | 100 |
101 } // namespace wm | 101 } // namespace wm |
102 } // namespace mash | 102 } // namespace mash |
103 | 103 |
104 #endif // MASH_WM_ROOT_WINDOW_CONTROLLER_H_ | 104 #endif // MASH_WM_ROOT_WINDOW_CONTROLLER_H_ |
OLD | NEW |