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

Unified Diff: components/mus/example/wm/window_manager_application.cc

Issue 1423133003: Routes calls to WM through WS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 5 years, 2 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: components/mus/example/wm/window_manager_application.cc
diff --git a/components/mus/example/wm/window_manager_application.cc b/components/mus/example/wm/window_manager_application.cc
index a59373fb933eb1b6595d2f602e8ca0a8b8c09744..550b66493b578a3506eac173ac65277cbe2d930b 100644
--- a/components/mus/example/wm/window_manager_application.cc
+++ b/components/mus/example/wm/window_manager_application.cc
@@ -29,7 +29,10 @@ mus::Window* WindowManagerApplication::GetWindowById(mus::Id id) {
}
void WindowManagerApplication::Initialize(mojo::ApplicationImpl* app) {
- mus::CreateSingleWindowTreeHost(app, this, &host_);
+ mus::mojom::WindowManagerPtr window_manager;
+ requests_.push_back(new mojo::InterfaceRequest<mus::mojom::WindowManager>(
+ mojo::GetProxy(&window_manager)));
+ mus::CreateSingleWindowTreeHost(app, this, &host_, window_manager.Pass());
}
bool WindowManagerApplication::ConfigureIncomingConnection(
@@ -47,8 +50,11 @@ void WindowManagerApplication::OnEmbed(mus::Window* root) {
host_->EnableWindowDraggingForChildren(
GetWindowForContainer(Container::USER_WINDOWS)->id());
- for (auto request : requests_)
- new WindowManagerImpl(this, request->Pass());
+ window_manager_.reset(new WindowManagerImpl(this));
+ for (auto request : requests_) {
Ben Goodger (Google) 2015/10/27 22:25:05 nit: no braces
sky 2015/10/27 22:30:27 Done.
+ window_manager_binding_.AddBinding(window_manager_.get(), request->Pass());
+ }
+ requests_.clear();
}
void WindowManagerApplication::OnConnectionLost(
@@ -61,7 +67,7 @@ void WindowManagerApplication::Create(
mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mus::mojom::WindowManager> request) {
if (root_) {
- new WindowManagerImpl(this, request.Pass());
+ window_manager_binding_.AddBinding(window_manager_.get(), request.Pass());
} else {
requests_.push_back(
new mojo::InterfaceRequest<mus::mojom::WindowManager>(request.Pass()));
« no previous file with comments | « components/mus/example/wm/window_manager_application.h ('k') | components/mus/example/wm/window_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698