| 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> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 namespace views { | 34 namespace views { |
| 35 class PointerWatcherEventRouter; | 35 class PointerWatcherEventRouter; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace wm { | 38 namespace wm { |
| 39 class WMState; | 39 class WMState; |
| 40 } | 40 } |
| 41 | 41 |
| 42 namespace ash { | 42 namespace ash { |
| 43 | 43 |
| 44 class RootWindowController; |
| 44 class ScreenMus; | 45 class ScreenMus; |
| 45 class SystemTrayDelegate; | 46 class SystemTrayDelegate; |
| 46 | 47 |
| 47 namespace mus { | 48 namespace mus { |
| 48 | 49 |
| 49 class AcceleratorHandler; | 50 class AcceleratorHandler; |
| 50 class RootWindowController; | |
| 51 class ShadowController; | 51 class ShadowController; |
| 52 class WmLookupMus; | 52 class WmLookupMus; |
| 53 class WmTestHelper; | 53 class WmTestHelper; |
| 54 | 54 |
| 55 // WindowManager serves as the WindowManagerDelegate and | 55 // WindowManager serves as the WindowManagerDelegate and |
| 56 // WindowTreeClientDelegate for mash. WindowManager creates (and owns) | 56 // WindowTreeClientDelegate for mash. WindowManager creates (and owns) |
| 57 // a RootWindowController per Display. WindowManager takes ownership of | 57 // a RootWindowController per Display. WindowManager takes ownership of |
| 58 // the WindowTreeClient. | 58 // the WindowTreeClient. |
| 59 class WindowManager : public aura::WindowManagerDelegate, | 59 class WindowManager : public aura::WindowManagerDelegate, |
| 60 public aura::WindowTreeClientDelegate { | 60 public aura::WindowTreeClientDelegate { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 77 aura::WindowManagerClient* window_manager_client() { | 77 aura::WindowManagerClient* window_manager_client() { |
| 78 return window_manager_client_; | 78 return window_manager_client_; |
| 79 } | 79 } |
| 80 | 80 |
| 81 service_manager::Connector* connector() { return connector_; } | 81 service_manager::Connector* connector() { return connector_; } |
| 82 | 82 |
| 83 aura::PropertyConverter* property_converter() { | 83 aura::PropertyConverter* property_converter() { |
| 84 return property_converter_.get(); | 84 return property_converter_.get(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Creates a new top level window. | |
| 88 aura::Window* NewTopLevelWindow( | |
| 89 ui::mojom::WindowType window_type, | |
| 90 std::map<std::string, std::vector<uint8_t>>* properties); | |
| 91 | |
| 92 std::set<RootWindowController*> GetRootWindowControllers(); | 87 std::set<RootWindowController*> GetRootWindowControllers(); |
| 93 | 88 |
| 94 // Returns the next accelerator namespace id by value in |id|. Returns true | 89 // Returns the next accelerator namespace id by value in |id|. Returns true |
| 95 // if there is another slot available, false if all slots are taken up. | 90 // if there is another slot available, false if all slots are taken up. |
| 96 bool GetNextAcceleratorNamespaceId(uint16_t* id); | 91 bool GetNextAcceleratorNamespaceId(uint16_t* id); |
| 97 void AddAcceleratorHandler(uint16_t id_namespace, | 92 void AddAcceleratorHandler(uint16_t id_namespace, |
| 98 AcceleratorHandler* handler); | 93 AcceleratorHandler* handler); |
| 99 void RemoveAcceleratorHandler(uint16_t id_namespace); | 94 void RemoveAcceleratorHandler(uint16_t id_namespace); |
| 100 | 95 |
| 101 // Returns the DisplayController interface if available. Will be null if no | 96 // Returns the DisplayController interface if available. Will be null if no |
| 102 // service_manager::Connector was available, for example in some tests. | 97 // service_manager::Connector was available, for example in some tests. |
| 103 display::mojom::DisplayController* GetDisplayController(); | 98 display::mojom::DisplayController* GetDisplayController(); |
| 104 | 99 |
| 105 // Called during creation of the shell to create a RootWindowController. | 100 // Called during creation of the shell to create a RootWindowController. |
| 106 // See comment in CreateRootWindowController() for details. | 101 // See comment in CreateRootWindowController() for details. |
| 107 void CreatePrimaryRootWindowController( | 102 void CreatePrimaryRootWindowController( |
| 108 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host); | 103 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host); |
| 109 | 104 |
| 110 private: | 105 private: |
| 111 friend class WmTestHelper; | 106 friend class WmTestHelper; |
| 112 | 107 |
| 113 using RootWindowControllers = std::set<std::unique_ptr<RootWindowController>>; | 108 using RootWindowControllers = std::set<std::unique_ptr<RootWindowController>>; |
| 114 | 109 |
| 115 // Called once the first Display has been obtained. | 110 // Called once the first Display has been obtained. |
| 116 void CreateShell( | 111 void CreateShell( |
| 117 std::unique_ptr<aura::WindowTreeHostMus> primary_window_tree_host); | 112 std::unique_ptr<aura::WindowTreeHostMus> primary_window_tree_host); |
| 118 | 113 |
| 119 void CreateRootWindowController( | 114 void CreateAndRegisterRootWindowController( |
| 120 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, | 115 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, |
| 121 const display::Display& display, | 116 const display::Display& display, |
| 122 ash::RootWindowController::RootWindowType root_window_type); | 117 ash::RootWindowController::RootWindowType root_window_type); |
| 123 | 118 |
| 124 // Deletes the specified RootWindowController. Called when a display is | 119 // Deletes the specified RootWindowController. Called when a display is |
| 125 // removed. |in_shutdown| is true if called from Shutdown(). | 120 // removed. |in_shutdown| is true if called from Shutdown(). |
| 126 void DestroyRootWindowController(RootWindowController* root_window_controller, | 121 void DestroyRootWindowController(RootWindowController* root_window_controller, |
| 127 bool in_shutdown); | 122 bool in_shutdown); |
| 128 | 123 |
| 129 void Shutdown(); | 124 void Shutdown(); |
| 130 | 125 |
| 131 RootWindowController* GetPrimaryRootWindowController(); | 126 RootWindowController* GetPrimaryRootWindowController(); |
| 132 | 127 |
| 133 // Returns the RootWindowController where new top levels are created. | |
| 134 // |properties| is the properties supplied during window creation. | |
| 135 RootWindowController* GetRootWindowControllerForNewTopLevelWindow( | |
| 136 std::map<std::string, std::vector<uint8_t>>* properties); | |
| 137 | |
| 138 // WindowTreeClientDelegate: | 128 // WindowTreeClientDelegate: |
| 139 void OnEmbed( | 129 void OnEmbed( |
| 140 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override; | 130 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override; |
| 141 void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; | 131 void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; |
| 142 void OnLostConnection(aura::WindowTreeClient* client) override; | 132 void OnLostConnection(aura::WindowTreeClient* client) override; |
| 143 void OnPointerEventObserved(const ui::PointerEvent& event, | 133 void OnPointerEventObserved(const ui::PointerEvent& event, |
| 144 aura::Window* target) override; | 134 aura::Window* target) override; |
| 145 aura::client::CaptureClient* GetCaptureClient() override; | 135 aura::client::CaptureClient* GetCaptureClient() override; |
| 146 aura::PropertyConverter* GetPropertyConverter() override; | 136 aura::PropertyConverter* GetPropertyConverter() override; |
| 147 | 137 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // create the various test delegates rather than a member. | 201 // create the various test delegates rather than a member. |
| 212 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_for_test_; | 202 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_for_test_; |
| 213 | 203 |
| 214 DISALLOW_COPY_AND_ASSIGN(WindowManager); | 204 DISALLOW_COPY_AND_ASSIGN(WindowManager); |
| 215 }; | 205 }; |
| 216 | 206 |
| 217 } // namespace mus | 207 } // namespace mus |
| 218 } // namespace ash | 208 } // namespace ash |
| 219 | 209 |
| 220 #endif // ASH_MUS_WINDOW_MANAGER_H_ | 210 #endif // ASH_MUS_WINDOW_MANAGER_H_ |
| OLD | NEW |