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 #include "mash/wm/window_manager_application.h" | 5 #include "mash/wm/window_manager_application.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "components/mus/public/cpp/event_matcher.h" | 10 #include "components/mus/public/cpp/event_matcher.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 } | 118 } |
119 | 119 |
120 bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { | 120 bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { |
121 connection->AddInterface<mash::wm::mojom::UserWindowController>(this); | 121 connection->AddInterface<mash::wm::mojom::UserWindowController>(this); |
122 connection->AddInterface<mus::mojom::AcceleratorRegistrar>(this); | 122 connection->AddInterface<mus::mojom::AcceleratorRegistrar>(this); |
123 if (connection->GetRemoteIdentity().name() == "mojo:mash_shell") | 123 if (connection->GetRemoteIdentity().name() == "mojo:mash_shell") |
124 connection->GetInterface(&mash_shell_); | 124 connection->GetInterface(&mash_shell_); |
125 return true; | 125 return true; |
126 } | 126 } |
127 | 127 |
| 128 void WindowManagerApplication::ShellConnectionLost() { |
| 129 _exit(1); |
| 130 } |
| 131 |
128 void WindowManagerApplication::Create( | 132 void WindowManagerApplication::Create( |
129 mojo::Connection* connection, | 133 mojo::Connection* connection, |
130 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { | 134 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { |
131 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { | 135 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { |
132 user_window_controller_binding_.AddBinding(user_window_controller_.get(), | 136 user_window_controller_binding_.AddBinding(user_window_controller_.get(), |
133 std::move(request)); | 137 std::move(request)); |
134 } else { | 138 } else { |
135 user_window_controller_requests_.push_back(make_scoped_ptr( | 139 user_window_controller_requests_.push_back(make_scoped_ptr( |
136 new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>( | 140 new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>( |
137 std::move(request)))); | 141 std::move(request)))); |
(...skipping 20 matching lines...) Expand all Loading... |
158 | 162 |
159 void WindowManagerApplication::CreateWindowManager( | 163 void WindowManagerApplication::CreateWindowManager( |
160 mus::mojom::DisplayPtr display, | 164 mus::mojom::DisplayPtr display, |
161 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { | 165 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { |
162 root_controllers_.insert(RootWindowController::CreateFromDisplay( | 166 root_controllers_.insert(RootWindowController::CreateFromDisplay( |
163 this, std::move(display), std::move(client_request))); | 167 this, std::move(display), std::move(client_request))); |
164 } | 168 } |
165 | 169 |
166 } // namespace wm | 170 } // namespace wm |
167 } // namespace mash | 171 } // namespace mash |
OLD | NEW |