| 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 MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 5 #ifndef MASH_WM_WINDOW_MANAGER_APPLICATION_H_ |
| 6 #define MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 6 #define MASH_WM_WINDOW_MANAGER_APPLICATION_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 "ash/public/interfaces/shelf_layout.mojom.h" |
| 14 #include "ash/public/interfaces/user_window_controller.mojom.h" |
| 13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 14 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 15 #include "components/mus/common/types.h" | 17 #include "components/mus/common/types.h" |
| 16 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" | 18 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" |
| 17 #include "components/mus/public/interfaces/window_manager.mojom.h" | 19 #include "components/mus/public/interfaces/window_manager.mojom.h" |
| 18 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" | 20 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" |
| 19 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 21 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
| 20 #include "mash/session/public/interfaces/session.mojom.h" | 22 #include "mash/session/public/interfaces/session.mojom.h" |
| 21 #include "mash/wm/public/interfaces/shelf_layout.mojom.h" | |
| 22 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" | |
| 23 #include "mojo/public/cpp/bindings/binding.h" | 23 #include "mojo/public/cpp/bindings/binding.h" |
| 24 #include "mojo/public/cpp/bindings/binding_set.h" | 24 #include "mojo/public/cpp/bindings/binding_set.h" |
| 25 #include "services/shell/public/cpp/shell_client.h" | 25 #include "services/shell/public/cpp/shell_client.h" |
| 26 #include "services/tracing/public/cpp/tracing_impl.h" | 26 #include "services/tracing/public/cpp/tracing_impl.h" |
| 27 | 27 |
| 28 namespace display { | 28 namespace display { |
| 29 class Screen; | 29 class Screen; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace views { | 32 namespace views { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 45 class RootWindowsObserver; | 45 class RootWindowsObserver; |
| 46 class ShelfLayoutImpl; | 46 class ShelfLayoutImpl; |
| 47 class UserWindowControllerImpl; | 47 class UserWindowControllerImpl; |
| 48 class WmGlobalsMus; | 48 class WmGlobalsMus; |
| 49 class WmLookupMus; | 49 class WmLookupMus; |
| 50 class WmScreen; | 50 class WmScreen; |
| 51 | 51 |
| 52 class WindowManagerApplication | 52 class WindowManagerApplication |
| 53 : public shell::ShellClient, | 53 : public shell::ShellClient, |
| 54 public mus::mojom::WindowManagerFactory, | 54 public mus::mojom::WindowManagerFactory, |
| 55 public shell::InterfaceFactory<mojom::ShelfLayout>, | 55 public shell::InterfaceFactory<ash::mojom::ShelfLayout>, |
| 56 public shell::InterfaceFactory<mojom::UserWindowController>, | 56 public shell::InterfaceFactory<ash::mojom::UserWindowController>, |
| 57 public shell::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { | 57 public shell::InterfaceFactory<mus::mojom::AcceleratorRegistrar> { |
| 58 public: | 58 public: |
| 59 WindowManagerApplication(); | 59 WindowManagerApplication(); |
| 60 ~WindowManagerApplication() override; | 60 ~WindowManagerApplication() override; |
| 61 | 61 |
| 62 shell::Connector* connector() { return connector_; } | 62 shell::Connector* connector() { return connector_; } |
| 63 | 63 |
| 64 // Returns the RootWindowControllers that have valid roots. | 64 // Returns the RootWindowControllers that have valid roots. |
| 65 // | 65 // |
| 66 // NOTE: this does not return |controllers_| as most clients want a | 66 // NOTE: this does not return |controllers_| as most clients want a |
| (...skipping 30 matching lines...) Expand all Loading... |
| 97 | 97 |
| 98 // Adds |root_window_controller| to the set of known roots. | 98 // Adds |root_window_controller| to the set of known roots. |
| 99 void AddRootWindowController(RootWindowController* root_window_controller); | 99 void AddRootWindowController(RootWindowController* root_window_controller); |
| 100 | 100 |
| 101 // shell::ShellClient: | 101 // shell::ShellClient: |
| 102 void Initialize(shell::Connector* connector, | 102 void Initialize(shell::Connector* connector, |
| 103 const shell::Identity& identity, | 103 const shell::Identity& identity, |
| 104 uint32_t id) override; | 104 uint32_t id) override; |
| 105 bool AcceptConnection(shell::Connection* connection) override; | 105 bool AcceptConnection(shell::Connection* connection) override; |
| 106 | 106 |
| 107 // shell::InterfaceFactory<mojom::ShelfLayout>: | 107 // shell::InterfaceFactory<ash::mojom::ShelfLayout>: |
| 108 void Create(shell::Connection* connection, | 108 void Create(shell::Connection* connection, |
| 109 mojo::InterfaceRequest<mojom::ShelfLayout> request) override; | 109 mojo::InterfaceRequest<ash::mojom::ShelfLayout> request) override; |
| 110 | 110 |
| 111 // shell::InterfaceFactory<mojom::UserWindowController>: | 111 // shell::InterfaceFactory<ash::mojom::UserWindowController>: |
| 112 void Create( | 112 void Create(shell::Connection* connection, |
| 113 shell::Connection* connection, | 113 mojo::InterfaceRequest<ash::mojom::UserWindowController> request) |
| 114 mojo::InterfaceRequest<mojom::UserWindowController> request) override; | 114 override; |
| 115 | 115 |
| 116 // shell::InterfaceFactory<mus::mojom::AcceleratorRegistrar>: | 116 // shell::InterfaceFactory<mus::mojom::AcceleratorRegistrar>: |
| 117 void Create(shell::Connection* connection, | 117 void Create(shell::Connection* connection, |
| 118 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) | 118 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) |
| 119 override; | 119 override; |
| 120 | 120 |
| 121 // mus::mojom::WindowManagerFactory: | 121 // mus::mojom::WindowManagerFactory: |
| 122 void CreateWindowManager(mus::mojom::DisplayPtr display, | 122 void CreateWindowManager(mus::mojom::DisplayPtr display, |
| 123 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> | 123 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> |
| 124 client_request) override; | 124 client_request) override; |
| 125 | 125 |
| 126 shell::Connector* connector_; | 126 shell::Connector* connector_; |
| 127 | 127 |
| 128 mojo::TracingImpl tracing_; | 128 mojo::TracingImpl tracing_; |
| 129 | 129 |
| 130 std::unique_ptr<display::Screen> screen_; | 130 std::unique_ptr<display::Screen> screen_; |
| 131 std::unique_ptr<views::AuraInit> aura_init_; | 131 std::unique_ptr<views::AuraInit> aura_init_; |
| 132 | 132 |
| 133 std::unique_ptr<WmGlobalsMus> globals_; | 133 std::unique_ptr<WmGlobalsMus> globals_; |
| 134 std::unique_ptr<WmLookupMus> lookup_; | 134 std::unique_ptr<WmLookupMus> lookup_; |
| 135 | 135 |
| 136 // The |shelf_layout_| object is created once OnEmbed() is called. Until that | 136 // The |shelf_layout_| object is created once OnEmbed() is called. Until that |
| 137 // time |shelf_layout_requests_| stores pending interface requests. | 137 // time |shelf_layout_requests_| stores pending interface requests. |
| 138 std::unique_ptr<ShelfLayoutImpl> shelf_layout_; | 138 std::unique_ptr<ShelfLayoutImpl> shelf_layout_; |
| 139 mojo::BindingSet<mojom::ShelfLayout> shelf_layout_bindings_; | 139 mojo::BindingSet<ash::mojom::ShelfLayout> shelf_layout_bindings_; |
| 140 std::vector<std::unique_ptr<mojo::InterfaceRequest<mojom::ShelfLayout>>> | 140 std::vector<std::unique_ptr<mojo::InterfaceRequest<ash::mojom::ShelfLayout>>> |
| 141 shelf_layout_requests_; | 141 shelf_layout_requests_; |
| 142 | 142 |
| 143 // |user_window_controller_| is created once OnEmbed() is called. Until that | 143 // |user_window_controller_| is created once OnEmbed() is called. Until that |
| 144 // time |user_window_controller_requests_| stores pending interface requests. | 144 // time |user_window_controller_requests_| stores pending interface requests. |
| 145 std::unique_ptr<UserWindowControllerImpl> user_window_controller_; | 145 std::unique_ptr<UserWindowControllerImpl> user_window_controller_; |
| 146 mojo::BindingSet<mojom::UserWindowController> | 146 mojo::BindingSet<ash::mojom::UserWindowController> |
| 147 user_window_controller_bindings_; | 147 user_window_controller_bindings_; |
| 148 std::vector< | 148 std::vector< |
| 149 std::unique_ptr<mojo::InterfaceRequest<mojom::UserWindowController>>> | 149 std::unique_ptr<mojo::InterfaceRequest<ash::mojom::UserWindowController>>> |
| 150 user_window_controller_requests_; | 150 user_window_controller_requests_; |
| 151 | 151 |
| 152 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; | 152 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; |
| 153 std::set<RootWindowController*> root_controllers_; | 153 std::set<RootWindowController*> root_controllers_; |
| 154 | 154 |
| 155 mojo::Binding<mus::mojom::WindowManagerFactory> | 155 mojo::Binding<mus::mojom::WindowManagerFactory> |
| 156 window_manager_factory_binding_; | 156 window_manager_factory_binding_; |
| 157 | 157 |
| 158 mash::session::mojom::SessionPtr session_; | 158 mash::session::mojom::SessionPtr session_; |
| 159 | 159 |
| 160 base::ObserverList<RootWindowsObserver> root_windows_observers_; | 160 base::ObserverList<RootWindowsObserver> root_windows_observers_; |
| 161 | 161 |
| 162 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 162 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 } // namespace wm | 165 } // namespace wm |
| 166 } // namespace mash | 166 } // namespace mash |
| 167 | 167 |
| 168 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ | 168 #endif // MASH_WM_WINDOW_MANAGER_APPLICATION_H_ |
| OLD | NEW |