| Index: ash/mus/window_manager_application.h
|
| diff --git a/ash/mus/window_manager_application.h b/ash/mus/window_manager_application.h
|
| index 65ef4943840efa127e8ded9362cf5063f6785bad..16a51bc7c0b09e86f6ec543ccd2a40bf45530449 100644
|
| --- a/ash/mus/window_manager_application.h
|
| +++ b/ash/mus/window_manager_application.h
|
| @@ -10,23 +10,20 @@
|
| #include <memory>
|
| #include <set>
|
|
|
| +#include "ash/mus/root_windows_observer.h"
|
| #include "ash/public/interfaces/shelf_layout.mojom.h"
|
| #include "ash/public/interfaces/user_window_controller.mojom.h"
|
| #include "base/macros.h"
|
| -#include "base/observer_list.h"
|
| #include "components/mus/common/types.h"
|
| #include "components/mus/public/interfaces/accelerator_registrar.mojom.h"
|
| -#include "components/mus/public/interfaces/window_manager.mojom.h"
|
| -#include "components/mus/public/interfaces/window_manager_factory.mojom.h"
|
| -#include "components/mus/public/interfaces/window_tree_host.mojom.h"
|
| #include "mash/session/public/interfaces/session.mojom.h"
|
| #include "mojo/public/cpp/bindings/binding.h"
|
| #include "mojo/public/cpp/bindings/binding_set.h"
|
| #include "services/shell/public/cpp/shell_client.h"
|
| #include "services/tracing/public/cpp/tracing_impl.h"
|
|
|
| -namespace display {
|
| -class Screen;
|
| +namespace mus {
|
| +class WindowTreeClient;
|
| }
|
|
|
| namespace views {
|
| @@ -42,49 +39,28 @@ namespace mus {
|
|
|
| class AcceleratorRegistrarImpl;
|
| class RootWindowController;
|
| -class RootWindowsObserver;
|
| class ShelfLayoutImpl;
|
| class UserWindowControllerImpl;
|
| -class WmShellMus;
|
| -class WmLookupMus;
|
| -class WmScreen;
|
| +class WindowManager;
|
|
|
| class WindowManagerApplication
|
| : public shell::ShellClient,
|
| - public ::mus::mojom::WindowManagerFactory,
|
| public shell::InterfaceFactory<mojom::ShelfLayout>,
|
| public shell::InterfaceFactory<mojom::UserWindowController>,
|
| - public shell::InterfaceFactory<::mus::mojom::AcceleratorRegistrar> {
|
| + public shell::InterfaceFactory<::mus::mojom::AcceleratorRegistrar>,
|
| + public mash::session::mojom::ScreenlockStateListener,
|
| + public RootWindowsObserver {
|
| public:
|
| WindowManagerApplication();
|
| ~WindowManagerApplication() override;
|
|
|
| shell::Connector* connector() { return connector_; }
|
|
|
| - // Returns the RootWindowControllers that have valid roots.
|
| - //
|
| - // NOTE: this does not return |controllers_| as most clients want a
|
| - // RootWindowController that has a valid root window.
|
| - std::set<RootWindowController*> GetRootControllers();
|
| -
|
| - WmShellMus* shell() { return shell_.get(); }
|
| -
|
| - // Called when the root window of |root_controller| is obtained.
|
| - void OnRootWindowControllerGotRoot(RootWindowController* root_controller);
|
| -
|
| - // Called after RootWindowController creates the necessary resources.
|
| - void OnRootWindowControllerDoneInit(RootWindowController* root_controller);
|
| -
|
| - // Called when the root mus::Window of RootWindowController is destroyed.
|
| - // |root_controller| is destroyed after this call.
|
| - void OnRootWindowDestroyed(RootWindowController* root_controller);
|
| + WindowManager* window_manager() { return window_manager_.get(); }
|
|
|
| // TODO(sky): figure out right place for this code.
|
| void OnAccelerator(uint32_t id, const ui::Event& event);
|
|
|
| - void AddRootWindowsObserver(RootWindowsObserver* observer);
|
| - void RemoveRootWindowsObserver(RootWindowsObserver* observer);
|
| -
|
| mash::session::mojom::Session* session() { return session_.get(); }
|
|
|
| private:
|
| @@ -93,8 +69,7 @@ class WindowManagerApplication
|
|
|
| void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar);
|
|
|
| - // Adds |root_window_controller| to the set of known roots.
|
| - void AddRootWindowController(RootWindowController* root_window_controller);
|
| + void InitWindowManager(::mus::WindowTreeClient* window_tree_client);
|
|
|
| // shell::ShellClient:
|
| void Initialize(shell::Connector* connector,
|
| @@ -116,22 +91,20 @@ class WindowManagerApplication
|
| mojo::InterfaceRequest<::mus::mojom::AcceleratorRegistrar>
|
| request) override;
|
|
|
| - // mus::mojom::WindowManagerFactory:
|
| - void CreateWindowManager(
|
| - ::mus::mojom::DisplayPtr display,
|
| - mojo::InterfaceRequest<::mus::mojom::WindowTreeClient> client_request)
|
| - override;
|
| + // session::mojom::ScreenlockStateListener:
|
| + void ScreenlockStateChanged(bool locked) override;
|
| +
|
| + // RootWindowsObserver:
|
| + void OnRootWindowControllerAdded(RootWindowController* controller) override;
|
| + void OnWillDestroyRootWindowController(
|
| + RootWindowController* controller) override;
|
|
|
| shell::Connector* connector_;
|
|
|
| mojo::TracingImpl tracing_;
|
|
|
| - std::unique_ptr<display::Screen> screen_;
|
| std::unique_ptr<views::AuraInit> aura_init_;
|
|
|
| - std::unique_ptr<WmShellMus> shell_;
|
| - std::unique_ptr<WmLookupMus> lookup_;
|
| -
|
| // The |shelf_layout_| object is created once OnEmbed() is called. Until that
|
| // time |shelf_layout_requests_| stores pending interface requests.
|
| std::unique_ptr<ShelfLayoutImpl> shelf_layout_;
|
| @@ -148,15 +121,14 @@ class WindowManagerApplication
|
| std::unique_ptr<mojo::InterfaceRequest<mojom::UserWindowController>>>
|
| user_window_controller_requests_;
|
|
|
| - std::set<AcceleratorRegistrarImpl*> accelerator_registrars_;
|
| - std::set<RootWindowController*> root_controllers_;
|
| + std::unique_ptr<WindowManager> window_manager_;
|
|
|
| - mojo::Binding<::mus::mojom::WindowManagerFactory>
|
| - window_manager_factory_binding_;
|
| + std::set<AcceleratorRegistrarImpl*> accelerator_registrars_;
|
|
|
| mash::session::mojom::SessionPtr session_;
|
|
|
| - base::ObserverList<RootWindowsObserver> root_windows_observers_;
|
| + mojo::Binding<mash::session::mojom::ScreenlockStateListener>
|
| + screenlock_state_listener_binding_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication);
|
| };
|
|
|