diff options
author | ben <ben@chromium.org> | 2016-02-29 15:12:33 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-29 23:13:49 +0000 |
commit | c6ec81a1d269112b0220fa575f8bba529b4e53c2 (patch) | |
tree | 9c56bd8a9241c9ae62cc0dc4764e2e32bfd5acbe /mash/wm | |
parent | 2a28406877d06cc4d7511295067c6be031e70e9d (diff) | |
download | chromium_src-c6ec81a1d269112b0220fa575f8bba529b4e53c2.zip chromium_src-c6ec81a1d269112b0220fa575f8bba529b4e53c2.tar.gz chromium_src-c6ec81a1d269112b0220fa575f8bba529b4e53c2.tar.bz2 |
Primitive login screen to mock out login flow.
BUG=
Review URL: https://codereview.chromium.org/1734063005
Cr-Commit-Position: refs/heads/master@{#378310}
Diffstat (limited to 'mash/wm')
-rw-r--r-- | mash/wm/root_window_controller.cc | 4 | ||||
-rw-r--r-- | mash/wm/window_manager.cc | 5 | ||||
-rw-r--r-- | mash/wm/window_manager.h | 2 | ||||
-rw-r--r-- | mash/wm/window_manager_application.cc | 2 | ||||
-rw-r--r-- | mash/wm/window_manager_application.h | 7 |
5 files changed, 14 insertions, 6 deletions
diff --git a/mash/wm/root_window_controller.cc b/mash/wm/root_window_controller.cc index 03de79e..a554310 100644 --- a/mash/wm/root_window_controller.cc +++ b/mash/wm/root_window_controller.cc @@ -144,9 +144,7 @@ void RootWindowController::OnEmbed(mus::Window* root) { AddAccelerators(); - mash::shell::mojom::ShellPtr shell; - app_->connector()->ConnectToInterface("mojo:mash_shell", &shell); - window_manager_->Initialize(this, std::move(shell)); + window_manager_->Initialize(this, app_->mash_shell()); shadow_controller_.reset(new ShadowController(root->connection())); diff --git a/mash/wm/window_manager.cc b/mash/wm/window_manager.cc index f57af0a..707daa2 100644 --- a/mash/wm/window_manager.cc +++ b/mash/wm/window_manager.cc @@ -39,7 +39,7 @@ WindowManager::~WindowManager() { } void WindowManager::Initialize(RootWindowController* root_controller, - mash::shell::mojom::ShellPtr shell) { + mash::shell::mojom::Shell* shell) { DCHECK(root_controller); DCHECK(!root_controller_); root_controller_ = root_controller; @@ -66,7 +66,8 @@ void WindowManager::Initialize(RootWindowController* root_controller, window_manager_client_->SetFrameDecorationValues( std::move(frame_decoration_values)); - shell->AddScreenlockStateListener(binding_.CreateInterfacePtrAndBind()); + if (shell) + shell->AddScreenlockStateListener(binding_.CreateInterfacePtrAndBind()); } gfx::Rect WindowManager::CalculateDefaultBounds(mus::Window* window) const { diff --git a/mash/wm/window_manager.h b/mash/wm/window_manager.h index 7dbe07e..1c79976 100644 --- a/mash/wm/window_manager.h +++ b/mash/wm/window_manager.h @@ -28,7 +28,7 @@ class WindowManager : public mus::WindowObserver, ~WindowManager() override; void Initialize(RootWindowController* root_controller, - mash::shell::mojom::ShellPtr shell); + mash::shell::mojom::Shell* shell); mus::WindowManagerClient* window_manager_client() { return window_manager_client_; diff --git a/mash/wm/window_manager_application.cc b/mash/wm/window_manager_application.cc index 5f5089a..f9ff9ea 100644 --- a/mash/wm/window_manager_application.cc +++ b/mash/wm/window_manager_application.cc @@ -124,6 +124,8 @@ void WindowManagerApplication::Initialize(mojo::Connector* connector, bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { connection->AddInterface<mash::wm::mojom::UserWindowController>(this); connection->AddInterface<mus::mojom::AcceleratorRegistrar>(this); + if (connection->GetRemoteApplicationName() == "mojo:mash_shell") + connection->GetInterface(&mash_shell_); return true; } diff --git a/mash/wm/window_manager_application.h b/mash/wm/window_manager_application.h index a716990..b10c1e4 100644 --- a/mash/wm/window_manager_application.h +++ b/mash/wm/window_manager_application.h @@ -17,6 +17,7 @@ #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/shell/public/interfaces/shell.mojom.h" #include "mash/wm/public/interfaces/user_window_controller.mojom.h" #include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/binding_set.h" @@ -74,6 +75,10 @@ class WindowManagerApplication void AddRootWindowsObserver(RootWindowsObserver* observer); void RemoveRootWindowsObserver(RootWindowsObserver* observer); + mash::shell::mojom::Shell* mash_shell() { + return mash_shell_.get(); + } + private: void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); @@ -119,6 +124,8 @@ class WindowManagerApplication mojo::Binding<mus::mojom::WindowManagerFactory> window_manager_factory_binding_; + mash::shell::mojom::ShellPtr mash_shell_; + base::ObserverList<RootWindowsObserver> root_windows_observers_; DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |