| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/mus/mus_app.h" | 5 #include "components/mus/mus_app.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 bool MandolineUIServicesApp::AcceptConnection(Connection* connection) { | 164 bool MandolineUIServicesApp::AcceptConnection(Connection* connection) { |
| 165 connection->AddInterface<Gpu>(this); | 165 connection->AddInterface<Gpu>(this); |
| 166 connection->AddInterface<mojom::DisplayManager>(this); | 166 connection->AddInterface<mojom::DisplayManager>(this); |
| 167 connection->AddInterface<mojom::UserAccessManager>(this); | 167 connection->AddInterface<mojom::UserAccessManager>(this); |
| 168 connection->AddInterface<WindowTreeHostFactory>(this); | 168 connection->AddInterface<WindowTreeHostFactory>(this); |
| 169 connection->AddInterface<mojom::WindowManagerFactoryService>(this); | 169 connection->AddInterface<mojom::WindowManagerFactoryService>(this); |
| 170 connection->AddInterface<mojom::WindowTreeFactory>(this); | 170 connection->AddInterface<mojom::WindowTreeFactory>(this); |
| 171 return true; | 171 return true; |
| 172 } | 172 } |
| 173 | 173 |
| 174 void MandolineUIServicesApp::ShellConnectionLost() { | |
| 175 // TODO: This should exit cleanly. | |
| 176 _exit(1); | |
| 177 } | |
| 178 | |
| 179 void MandolineUIServicesApp::OnFirstDisplayReady() { | 174 void MandolineUIServicesApp::OnFirstDisplayReady() { |
| 180 PendingRequests requests; | 175 PendingRequests requests; |
| 181 requests.swap(pending_requests_); | 176 requests.swap(pending_requests_); |
| 182 for (auto& request : requests) | 177 for (auto& request : requests) |
| 183 Create(request->connection, std::move(*request->wtf_request)); | 178 Create(request->connection, std::move(*request->wtf_request)); |
| 184 } | 179 } |
| 185 | 180 |
| 186 void MandolineUIServicesApp::OnNoMoreDisplays() { | 181 void MandolineUIServicesApp::OnNoMoreDisplays() { |
| 187 // We may get here from the destructor, in which case there is no messageloop. | 182 // We may get here from the destructor, in which case there is no messageloop. |
| 188 if (base::MessageLoop::current()) | 183 if (base::MessageLoop::current()) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 user_state->window_tree_host_factory->AddBinding(std::move(request)); | 254 user_state->window_tree_host_factory->AddBinding(std::move(request)); |
| 260 } | 255 } |
| 261 | 256 |
| 262 void MandolineUIServicesApp::Create(mojo::Connection* connection, | 257 void MandolineUIServicesApp::Create(mojo::Connection* connection, |
| 263 mojom::GpuRequest request) { | 258 mojom::GpuRequest request) { |
| 264 DCHECK(platform_display_init_params_.gpu_state); | 259 DCHECK(platform_display_init_params_.gpu_state); |
| 265 new GpuImpl(std::move(request), platform_display_init_params_.gpu_state); | 260 new GpuImpl(std::move(request), platform_display_init_params_.gpu_state); |
| 266 } | 261 } |
| 267 | 262 |
| 268 } // namespace mus | 263 } // namespace mus |
| OLD | NEW |