| 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_client.h" |
| 12 #include "components/mus/public/cpp/window_tree_client_delegate.h" |
| 12 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" | 13 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" |
| 13 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 14 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
| 14 #include "mash/wm/public/interfaces/container.mojom.h" | 15 #include "mash/wm/public/interfaces/container.mojom.h" |
| 15 #include "mash/wm/shelf_layout_manager_delegate.h" | 16 #include "mash/wm/shelf_layout_manager_delegate.h" |
| 16 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
| 17 #include "ui/display/display.h" | 18 #include "ui/display/display.h" |
| 18 | 19 |
| 19 namespace ash { | 20 namespace ash { |
| 20 class AlwaysOnTopController; | 21 class AlwaysOnTopController; |
| 21 } | 22 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 class WmRootWindowControllerMus; | 45 class WmRootWindowControllerMus; |
| 45 class WmShelfMus; | 46 class WmShelfMus; |
| 46 class WmTestBase; | 47 class WmTestBase; |
| 47 class WmTestHelper; | 48 class WmTestHelper; |
| 48 | 49 |
| 49 // RootWindowController manages the windows and state for a single display. | 50 // RootWindowController manages the windows and state for a single display. |
| 50 // | 51 // |
| 51 // RootWindowController deletes itself when the root mus::Window is destroyed. | 52 // RootWindowController deletes itself when the root mus::Window is destroyed. |
| 52 // You can trigger deletion explicitly by way of Destroy(). | 53 // You can trigger deletion explicitly by way of Destroy(). |
| 53 class RootWindowController : public mus::WindowObserver, | 54 class RootWindowController : public mus::WindowObserver, |
| 54 public mus::WindowTreeDelegate, | 55 public mus::WindowTreeClientDelegate, |
| 55 public ShelfLayoutManagerDelegate { | 56 public ShelfLayoutManagerDelegate { |
| 56 public: | 57 public: |
| 57 static RootWindowController* CreateFromDisplay( | 58 static RootWindowController* CreateFromDisplay( |
| 58 WindowManagerApplication* app, | 59 WindowManagerApplication* app, |
| 59 mus::mojom::DisplayPtr display, | 60 mus::mojom::DisplayPtr display, |
| 60 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request); | 61 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request); |
| 61 | 62 |
| 62 // Deletes this. | 63 // Deletes this. |
| 63 void Destroy(); | 64 void Destroy(); |
| 64 | 65 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 91 | 92 |
| 92 private: | 93 private: |
| 93 friend class WmTestBase; | 94 friend class WmTestBase; |
| 94 friend class WmTestHelper; | 95 friend class WmTestHelper; |
| 95 | 96 |
| 96 explicit RootWindowController(WindowManagerApplication* app); | 97 explicit RootWindowController(WindowManagerApplication* app); |
| 97 ~RootWindowController() override; | 98 ~RootWindowController() override; |
| 98 | 99 |
| 99 void AddAccelerators(); | 100 void AddAccelerators(); |
| 100 | 101 |
| 101 // WindowTreeDelegate: | 102 // WindowTreeClientDelegate: |
| 102 void OnEmbed(mus::Window* root) override; | 103 void OnEmbed(mus::Window* root) override; |
| 103 void OnConnectionLost(mus::WindowTreeConnection* connection) override; | 104 void OnWindowTreeClientDestroyed(mus::WindowTreeClient* client) override; |
| 104 void OnEventObserved(const ui::Event& event, mus::Window* target) override; | 105 void OnEventObserved(const ui::Event& event, mus::Window* target) override; |
| 105 | 106 |
| 106 // mus::WindowObserver: | 107 // mus::WindowObserver: |
| 107 void OnWindowDestroyed(mus::Window* window) override; | 108 void OnWindowDestroyed(mus::Window* window) override; |
| 108 | 109 |
| 109 // ShelfLayoutManagerDelegate: | 110 // ShelfLayoutManagerDelegate: |
| 110 void OnShelfWindowAvailable() override; | 111 void OnShelfWindowAvailable() override; |
| 111 | 112 |
| 112 // Sets up the window containers used for z-space management. | 113 // Sets up the window containers used for z-space management. |
| 113 void CreateContainer(mash::wm::mojom::Container container, | 114 void CreateContainer(mash::wm::mojom::Container container, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 131 | 132 |
| 132 std::unique_ptr<ash::AlwaysOnTopController> always_on_top_controller_; | 133 std::unique_ptr<ash::AlwaysOnTopController> always_on_top_controller_; |
| 133 | 134 |
| 134 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 135 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
| 135 }; | 136 }; |
| 136 | 137 |
| 137 } // namespace wm | 138 } // namespace wm |
| 138 } // namespace mash | 139 } // namespace mash |
| 139 | 140 |
| 140 #endif // MASH_WM_ROOT_WINDOW_CONTROLLER_H_ | 141 #endif // MASH_WM_ROOT_WINDOW_CONTROLLER_H_ |
| OLD | NEW |