Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: mash/wm/window_manager_application.cc

Issue 1576683002: Add rudimentary mash shelf functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mash/wm/window_manager_application.cc
diff --git a/mash/wm/window_manager_application.cc b/mash/wm/window_manager_application.cc
index 748bc481030b538efb942bc6f6a5ffc0c34199b9..2110dce0a0233a77d6d64b39c371052f4e7f52b3 100644
--- a/mash/wm/window_manager_application.cc
+++ b/mash/wm/window_manager_application.cc
@@ -17,6 +17,7 @@
#include "mash/wm/background_layout.h"
#include "mash/wm/shadow_controller.h"
#include "mash/wm/shelf_layout.h"
+#include "mash/wm/user_window_controller_impl.h"
#include "mash/wm/window_layout.h"
#include "mash/wm/window_manager_impl.h"
#include "mojo/services/tracing/public/cpp/tracing_impl.h"
@@ -81,6 +82,7 @@ void WindowManagerApplication::Initialize(mojo::ApplicationImpl* app) {
mus::mojom::WindowManagerPtr window_manager;
requests_.push_back(new mojo::InterfaceRequest<mus::mojom::WindowManager>(
mojo::GetProxy(&window_manager)));
+ user_window_controller_.reset(new UserWindowControllerImpl());
mus::mojom::WindowTreeHostClientPtr host_client;
host_client_binding_.Bind(GetProxy(&host_client));
mus::CreateSingleWindowTreeHost(app, std::move(host_client), this,
@@ -90,6 +92,7 @@ void WindowManagerApplication::Initialize(mojo::ApplicationImpl* app) {
bool WindowManagerApplication::ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) {
+ connection->AddService<mash::wm::mojom::UserWindowController>(this);
connection->AddService<mus::mojom::AcceleratorRegistrar>(this);
connection->AddService<mus::mojom::WindowManager>(this);
return true;
@@ -137,6 +140,12 @@ void WindowManagerApplication::OnEmbed(mus::Window* root) {
std::move(*request));
requests_.clear();
+ user_window_controller_->Initialize(this);
+ for (auto request : user_window_controller_requests_)
+ user_window_controller_binding_.AddBinding(user_window_controller_.get(),
+ std::move(*request));
+ user_window_controller_requests_.clear();
+
shadow_controller_.reset(new ShadowController(root->connection()));
}
@@ -149,6 +158,19 @@ void WindowManagerApplication::OnConnectionLost(
void WindowManagerApplication::Create(
mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) {
+ if (root_) {
+ user_window_controller_binding_.AddBinding(user_window_controller_.get(),
+ std::move(request));
+ } else {
+ user_window_controller_requests_.push_back(
+ new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>(
+ std::move(request)));
+ }
+}
+
+void WindowManagerApplication::Create(
+ mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) {
static int accelerator_registrar_count = 0;
if (accelerator_registrar_count == std::numeric_limits<int>::max()) {
« mash/wm/window_manager_application.h ('K') | « mash/wm/window_manager_application.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698