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 ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ | 5 #ifndef ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ |
6 #define ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ | 6 #define ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/mus/shelf_layout_manager_delegate.h" | 10 #include "ash/mus/shelf_layout_manager_delegate.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class Connector; | 25 class Connector; |
26 } | 26 } |
27 | 27 |
28 namespace ui { | 28 namespace ui { |
29 class Event; | 29 class Event; |
30 } | 30 } |
31 | 31 |
32 namespace ash { | 32 namespace ash { |
33 | 33 |
34 class AlwaysOnTopController; | 34 class AlwaysOnTopController; |
| 35 class RootWindowControllerCommon; |
35 | 36 |
36 namespace mus { | 37 namespace mus { |
37 | 38 |
38 class LayoutManager; | 39 class LayoutManager; |
39 class ShadowController; | 40 class ShadowController; |
40 class ShelfLayoutManager; | 41 class ShelfLayoutManager; |
41 class StatusLayoutManager; | 42 class StatusLayoutManager; |
42 class WindowManager; | 43 class WindowManager; |
43 class WindowManagerApplication; | 44 class WindowManagerApplication; |
44 class WmRootWindowControllerMus; | 45 class WmRootWindowControllerMus; |
45 class WmShelfMus; | 46 class WmShelfMus; |
46 class WmTestBase; | 47 class WmTestBase; |
47 class WmTestHelper; | 48 class WmTestHelper; |
| 49 class WmWindowMus; |
48 | 50 |
49 // RootWindowController manages the windows and state for a single display. | 51 // RootWindowController manages the windows and state for a single display. |
50 // | 52 // |
51 // RootWindowController deletes itself when the root mus::Window is destroyed. | 53 // RootWindowController deletes itself when the root mus::Window is destroyed. |
52 // You can trigger deletion explicitly by way of Destroy(). | 54 // You can trigger deletion explicitly by way of Destroy(). |
53 class RootWindowController : public ::mus::WindowObserver, | 55 class RootWindowController : public ::mus::WindowObserver, |
54 public ::mus::WindowTreeClientDelegate, | 56 public ::mus::WindowTreeClientDelegate, |
55 public ShelfLayoutManagerDelegate { | 57 public ShelfLayoutManagerDelegate { |
56 public: | 58 public: |
57 static RootWindowController* CreateFromDisplay( | 59 static RootWindowController* CreateFromDisplay( |
58 WindowManagerApplication* app, | 60 WindowManagerApplication* app, |
59 ::mus::mojom::DisplayPtr display, | 61 ::mus::mojom::DisplayPtr display, |
60 mojo::InterfaceRequest<::mus::mojom::WindowTreeClient> client_request); | 62 mojo::InterfaceRequest<::mus::mojom::WindowTreeClient> client_request); |
61 | 63 |
62 // Deletes this. | 64 // Deletes this. |
63 void Destroy(); | 65 void Destroy(); |
64 | 66 |
65 shell::Connector* GetConnector(); | 67 shell::Connector* GetConnector(); |
66 | 68 |
67 ::mus::Window* root() { return root_; } | 69 ::mus::Window* root() { return root_; } |
68 | 70 |
69 int window_count() { return window_count_; } | 71 int window_count() { return window_count_; } |
70 void IncrementWindowCount() { ++window_count_; } | 72 void IncrementWindowCount() { ++window_count_; } |
71 | 73 |
72 ::mus::Window* GetWindowForContainer(mojom::Container container); | 74 ::mus::Window* GetWindowForContainer(mojom::Container container); |
73 bool WindowIsContainer(const ::mus::Window* window) const; | 75 bool WindowIsContainer(::mus::Window* window); |
| 76 |
| 77 WmWindowMus* GetWindowByShellWindowId(int id); |
74 | 78 |
75 WindowManager* window_manager() { return window_manager_.get(); } | 79 WindowManager* window_manager() { return window_manager_.get(); } |
76 | 80 |
77 ::mus::WindowManagerClient* window_manager_client(); | 81 ::mus::WindowManagerClient* window_manager_client(); |
78 | 82 |
79 void OnAccelerator(uint32_t id, const ui::Event& event); | 83 void OnAccelerator(uint32_t id, const ui::Event& event); |
80 | 84 |
81 const display::Display& display() const { return display_; } | 85 const display::Display& display() const { return display_; } |
82 | 86 |
83 ShelfLayoutManager* GetShelfLayoutManager(); | 87 ShelfLayoutManager* GetShelfLayoutManager(); |
(...skipping 18 matching lines...) Expand all Loading... |
102 void OnEmbed(::mus::Window* root) override; | 106 void OnEmbed(::mus::Window* root) override; |
103 void OnWindowTreeClientDestroyed(::mus::WindowTreeClient* client) override; | 107 void OnWindowTreeClientDestroyed(::mus::WindowTreeClient* client) override; |
104 void OnEventObserved(const ui::Event& event, ::mus::Window* target) override; | 108 void OnEventObserved(const ui::Event& event, ::mus::Window* target) override; |
105 | 109 |
106 // ::mus::WindowObserver: | 110 // ::mus::WindowObserver: |
107 void OnWindowDestroyed(::mus::Window* window) override; | 111 void OnWindowDestroyed(::mus::Window* window) override; |
108 | 112 |
109 // ShelfLayoutManagerDelegate: | 113 // ShelfLayoutManagerDelegate: |
110 void OnShelfWindowAvailable() override; | 114 void OnShelfWindowAvailable() override; |
111 | 115 |
112 // Sets up the window containers used for z-space management. | 116 // Creates the necessary set of layout managers in the shell windows. |
113 void CreateContainer(mojom::Container container, | 117 void CreateLayoutManagers(); |
114 mojom::Container parent_container); | |
115 void CreateContainers(); | |
116 | 118 |
117 WindowManagerApplication* app_; | 119 WindowManagerApplication* app_; |
118 ::mus::Window* root_; | 120 ::mus::Window* root_; |
119 int window_count_; | 121 int window_count_; |
120 | 122 |
| 123 std::unique_ptr<RootWindowControllerCommon> root_window_controller_common_; |
| 124 |
121 std::unique_ptr<WmRootWindowControllerMus> wm_root_window_controller_; | 125 std::unique_ptr<WmRootWindowControllerMus> wm_root_window_controller_; |
122 std::unique_ptr<WmShelfMus> wm_shelf_; | 126 std::unique_ptr<WmShelfMus> wm_shelf_; |
123 | 127 |
124 std::unique_ptr<WindowManager> window_manager_; | 128 std::unique_ptr<WindowManager> window_manager_; |
125 | 129 |
126 std::map<::mus::Window*, std::unique_ptr<LayoutManager>> layout_managers_; | 130 std::map<::mus::Window*, std::unique_ptr<LayoutManager>> layout_managers_; |
127 | 131 |
128 std::unique_ptr<ShadowController> shadow_controller_; | 132 std::unique_ptr<ShadowController> shadow_controller_; |
129 | 133 |
130 display::Display display_; | 134 display::Display display_; |
131 | 135 |
132 std::unique_ptr<AlwaysOnTopController> always_on_top_controller_; | 136 std::unique_ptr<AlwaysOnTopController> always_on_top_controller_; |
133 | 137 |
134 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 138 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
135 }; | 139 }; |
136 | 140 |
137 } // namespace mus | 141 } // namespace mus |
138 } // namespace ash | 142 } // namespace ash |
139 | 143 |
140 #endif // ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ | 144 #endif // ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ |
OLD | NEW |