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_H_ | 5 #ifndef ASH_MUS_WINDOW_MANAGER_H_ |
6 #define ASH_MUS_WINDOW_MANAGER_H_ | 6 #define ASH_MUS_WINDOW_MANAGER_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 "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "services/ui/common/types.h" | 16 #include "services/ui/common/types.h" |
17 #include "services/ui/public/cpp/window_manager_delegate.h" | 17 #include "services/ui/public/cpp/window_manager_delegate.h" |
18 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 18 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
19 #include "services/ui/public/interfaces/window_manager.mojom.h" | 19 #include "services/ui/public/interfaces/window_manager.mojom.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class SequencedWorkerPool; | 22 class SequencedWorkerPool; |
23 } | 23 } |
24 | 24 |
25 namespace display { | 25 namespace display { |
26 class Display; | 26 class Display; |
27 class ScreenBase; | 27 class ScreenBase; |
28 } | 28 } |
29 | 29 |
30 namespace shell { | 30 namespace service_manager { |
31 class Connector; | 31 class Connector; |
32 } | 32 } |
33 | 33 |
34 namespace views { | 34 namespace views { |
35 class PointerWatcherEventRouter; | 35 class PointerWatcherEventRouter; |
36 } | 36 } |
37 | 37 |
38 namespace ash { | 38 namespace ash { |
39 namespace mus { | 39 namespace mus { |
40 | 40 |
41 class AcceleratorHandler; | 41 class AcceleratorHandler; |
42 class RootWindowController; | 42 class RootWindowController; |
43 class ShadowController; | 43 class ShadowController; |
44 class WindowManagerObserver; | 44 class WindowManagerObserver; |
45 class WmShellMus; | 45 class WmShellMus; |
46 class WmLookupMus; | 46 class WmLookupMus; |
47 class WmTestHelper; | 47 class WmTestHelper; |
48 | 48 |
49 // WindowManager serves as the WindowManagerDelegate and | 49 // WindowManager serves as the WindowManagerDelegate and |
50 // WindowTreeClientDelegate for mash. WindowManager creates (and owns) | 50 // WindowTreeClientDelegate for mash. WindowManager creates (and owns) |
51 // a RootWindowController per Display. WindowManager takes ownership of | 51 // a RootWindowController per Display. WindowManager takes ownership of |
52 // the WindowTreeClient. | 52 // the WindowTreeClient. |
53 class WindowManager : public ui::WindowManagerDelegate, | 53 class WindowManager : public ui::WindowManagerDelegate, |
54 public ui::WindowTreeClientDelegate { | 54 public ui::WindowTreeClientDelegate { |
55 public: | 55 public: |
56 explicit WindowManager(shell::Connector* connector); | 56 explicit WindowManager(service_manager::Connector* connector); |
57 ~WindowManager() override; | 57 ~WindowManager() override; |
58 | 58 |
59 void Init(std::unique_ptr<ui::WindowTreeClient> window_tree_client, | 59 void Init(std::unique_ptr<ui::WindowTreeClient> window_tree_client, |
60 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool); | 60 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool); |
61 | 61 |
62 WmShellMus* shell() { return shell_.get(); } | 62 WmShellMus* shell() { return shell_.get(); } |
63 | 63 |
64 display::ScreenBase* screen() { return screen_.get(); } | 64 display::ScreenBase* screen() { return screen_.get(); } |
65 | 65 |
66 ui::WindowTreeClient* window_tree_client() { | 66 ui::WindowTreeClient* window_tree_client() { |
67 return window_tree_client_.get(); | 67 return window_tree_client_.get(); |
68 } | 68 } |
69 | 69 |
70 ui::WindowManagerClient* window_manager_client() { | 70 ui::WindowManagerClient* window_manager_client() { |
71 return window_manager_client_; | 71 return window_manager_client_; |
72 } | 72 } |
73 | 73 |
74 shell::Connector* connector() { return connector_; } | 74 service_manager::Connector* connector() { return connector_; } |
75 | 75 |
76 void SetScreenLocked(bool is_locked); | 76 void SetScreenLocked(bool is_locked); |
77 | 77 |
78 // Creates a new top level window. | 78 // Creates a new top level window. |
79 ui::Window* NewTopLevelWindow( | 79 ui::Window* NewTopLevelWindow( |
80 std::map<std::string, std::vector<uint8_t>>* properties); | 80 std::map<std::string, std::vector<uint8_t>>* properties); |
81 | 81 |
82 std::set<RootWindowController*> GetRootWindowControllers(); | 82 std::set<RootWindowController*> GetRootWindowControllers(); |
83 | 83 |
84 // Returns the next accelerator namespace id by value in |id|. Returns true | 84 // Returns the next accelerator namespace id by value in |id|. Returns true |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const display::Display& display) override; | 142 const display::Display& display) override; |
143 void OnWmDisplayRemoved(ui::Window* window) override; | 143 void OnWmDisplayRemoved(ui::Window* window) override; |
144 void OnWmPerformMoveLoop(ui::Window* window, | 144 void OnWmPerformMoveLoop(ui::Window* window, |
145 ui::mojom::MoveLoopSource source, | 145 ui::mojom::MoveLoopSource source, |
146 const gfx::Point& cursor_location, | 146 const gfx::Point& cursor_location, |
147 const base::Callback<void(bool)>& on_done) override; | 147 const base::Callback<void(bool)>& on_done) override; |
148 void OnWmCancelMoveLoop(ui::Window* window) override; | 148 void OnWmCancelMoveLoop(ui::Window* window) override; |
149 ui::mojom::EventResult OnAccelerator(uint32_t id, | 149 ui::mojom::EventResult OnAccelerator(uint32_t id, |
150 const ui::Event& event) override; | 150 const ui::Event& event) override; |
151 | 151 |
152 shell::Connector* connector_; | 152 service_manager::Connector* connector_; |
153 | 153 |
154 std::unique_ptr<ui::WindowTreeClient> window_tree_client_; | 154 std::unique_ptr<ui::WindowTreeClient> window_tree_client_; |
155 | 155 |
156 ui::WindowManagerClient* window_manager_client_ = nullptr; | 156 ui::WindowManagerClient* window_manager_client_ = nullptr; |
157 | 157 |
158 std::unique_ptr<views::PointerWatcherEventRouter> | 158 std::unique_ptr<views::PointerWatcherEventRouter> |
159 pointer_watcher_event_router_; | 159 pointer_watcher_event_router_; |
160 | 160 |
161 std::unique_ptr<ShadowController> shadow_controller_; | 161 std::unique_ptr<ShadowController> shadow_controller_; |
162 | 162 |
(...skipping 10 matching lines...) Expand all Loading... |
173 std::map<uint16_t, AcceleratorHandler*> accelerator_handlers_; | 173 std::map<uint16_t, AcceleratorHandler*> accelerator_handlers_; |
174 uint16_t next_accelerator_namespace_id_ = 0u; | 174 uint16_t next_accelerator_namespace_id_ = 0u; |
175 | 175 |
176 DISALLOW_COPY_AND_ASSIGN(WindowManager); | 176 DISALLOW_COPY_AND_ASSIGN(WindowManager); |
177 }; | 177 }; |
178 | 178 |
179 } // namespace mus | 179 } // namespace mus |
180 } // namespace ash | 180 } // namespace ash |
181 | 181 |
182 #endif // ASH_MUS_WINDOW_MANAGER_H_ | 182 #endif // ASH_MUS_WINDOW_MANAGER_H_ |
OLD | NEW |