| 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 12 matching lines...) Expand all Loading... |
| 23 class Screen; | 23 class Screen; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace shell { | 26 namespace shell { |
| 27 class Connector; | 27 class Connector; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace ash { | 30 namespace ash { |
| 31 namespace mus { | 31 namespace mus { |
| 32 | 32 |
| 33 class AcceleratorHandler; |
| 33 class RootWindowController; | 34 class RootWindowController; |
| 34 class ShadowController; | 35 class ShadowController; |
| 35 class WindowManagerObserver; | 36 class WindowManagerObserver; |
| 36 class WmShellMus; | 37 class WmShellMus; |
| 37 class WmLookupMus; | 38 class WmLookupMus; |
| 38 class WmTestHelper; | 39 class WmTestHelper; |
| 39 | 40 |
| 40 // WindowManager serves as the WindowManagerDelegate and | 41 // WindowManager serves as the WindowManagerDelegate and |
| 41 // WindowTreeClientDelegate for mash. WindowManager creates (and owns) | 42 // WindowTreeClientDelegate for mash. WindowManager creates (and owns) |
| 42 // a RootWindowController per Display. WindowManager takes ownership of | 43 // a RootWindowController per Display. WindowManager takes ownership of |
| (...skipping 18 matching lines...) Expand all Loading... |
| 61 shell::Connector* connector() { return connector_; } | 62 shell::Connector* connector() { return connector_; } |
| 62 | 63 |
| 63 void SetScreenLocked(bool is_locked); | 64 void SetScreenLocked(bool is_locked); |
| 64 | 65 |
| 65 // Creates a new top level window. | 66 // Creates a new top level window. |
| 66 ::ui::Window* NewTopLevelWindow( | 67 ::ui::Window* NewTopLevelWindow( |
| 67 std::map<std::string, std::vector<uint8_t>>* properties); | 68 std::map<std::string, std::vector<uint8_t>>* properties); |
| 68 | 69 |
| 69 std::set<RootWindowController*> GetRootWindowControllers(); | 70 std::set<RootWindowController*> GetRootWindowControllers(); |
| 70 | 71 |
| 72 // Returns the next accelerator namespace id by value in |id|. Returns true |
| 73 // if there is another slot available, false if all slots are taken up. |
| 74 bool GetNextAcceleratorNamespaceId(uint16_t* id); |
| 75 void AddAcceleratorHandler(uint16_t id_namespace, |
| 76 AcceleratorHandler* handler); |
| 77 void RemoveAcceleratorHandler(uint16_t id_namespace); |
| 78 |
| 71 void AddObserver(WindowManagerObserver* observer); | 79 void AddObserver(WindowManagerObserver* observer); |
| 72 void RemoveObserver(WindowManagerObserver* observer); | 80 void RemoveObserver(WindowManagerObserver* observer); |
| 73 | 81 |
| 74 private: | 82 private: |
| 75 friend class WmTestHelper; | 83 friend class WmTestHelper; |
| 76 | 84 |
| 77 void AddAccelerators(); | |
| 78 | |
| 79 RootWindowController* CreateRootWindowController( | 85 RootWindowController* CreateRootWindowController( |
| 80 ::ui::Window* window, | 86 ::ui::Window* window, |
| 81 const display::Display& display); | 87 const display::Display& display); |
| 82 | 88 |
| 83 // ::ui::WindowObserver: | 89 // ::ui::WindowObserver: |
| 84 void OnWindowDestroying(::ui::Window* window) override; | 90 void OnWindowDestroying(::ui::Window* window) override; |
| 85 void OnWindowDestroyed(::ui::Window* window) override; | 91 void OnWindowDestroyed(::ui::Window* window) override; |
| 86 | 92 |
| 87 // WindowTreeClientDelegate: | 93 // WindowTreeClientDelegate: |
| 88 void OnEmbed(::ui::Window* root) override; | 94 void OnEmbed(::ui::Window* root) override; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 std::set<std::unique_ptr<RootWindowController>> root_window_controllers_; | 127 std::set<std::unique_ptr<RootWindowController>> root_window_controllers_; |
| 122 | 128 |
| 123 base::ObserverList<WindowManagerObserver> observers_; | 129 base::ObserverList<WindowManagerObserver> observers_; |
| 124 | 130 |
| 125 std::unique_ptr<display::Screen> screen_; | 131 std::unique_ptr<display::Screen> screen_; |
| 126 | 132 |
| 127 std::unique_ptr<WmShellMus> shell_; | 133 std::unique_ptr<WmShellMus> shell_; |
| 128 | 134 |
| 129 std::unique_ptr<WmLookupMus> lookup_; | 135 std::unique_ptr<WmLookupMus> lookup_; |
| 130 | 136 |
| 137 std::map<uint16_t, AcceleratorHandler*> accelerator_handlers_; |
| 138 uint16_t next_accelerator_namespace_id_ = 0u; |
| 139 |
| 131 DISALLOW_COPY_AND_ASSIGN(WindowManager); | 140 DISALLOW_COPY_AND_ASSIGN(WindowManager); |
| 132 }; | 141 }; |
| 133 | 142 |
| 134 } // namespace mus | 143 } // namespace mus |
| 135 } // namespace ash | 144 } // namespace ash |
| 136 | 145 |
| 137 #endif // ASH_MUS_WINDOW_MANAGER_H_ | 146 #endif // ASH_MUS_WINDOW_MANAGER_H_ |
| OLD | NEW |