| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 DCHECK(ui::ClientNativePixmapFactory::GetInstance()); | 167 DCHECK(ui::ClientNativePixmapFactory::GetInstance()); |
| 168 #endif | 168 #endif |
| 169 | 169 |
| 170 // TODO(rjkroege): Enter sandbox here before we start threads in GpuState | 170 // TODO(rjkroege): Enter sandbox here before we start threads in GpuState |
| 171 // http://crbug.com/584532 | 171 // http://crbug.com/584532 |
| 172 | 172 |
| 173 #if !defined(OS_ANDROID) | 173 #if !defined(OS_ANDROID) |
| 174 event_source_ = ui::PlatformEventSource::CreateDefault(); | 174 event_source_ = ui::PlatformEventSource::CreateDefault(); |
| 175 #endif | 175 #endif |
| 176 | 176 |
| 177 // This needs to happen after DeviceDataManager has been constructed. That |
| 178 // happens either during OzonePlatform or PlatformEventSource initialization, |
| 179 // so keep this line below both of those. |
| 180 input_device_server_.RegisterAsObserver(); |
| 181 |
| 177 // TODO(rjkroege): It is possible that we might want to generalize the | 182 // TODO(rjkroege): It is possible that we might want to generalize the |
| 178 // GpuState object. | 183 // GpuState object. |
| 179 platform_display_init_params_.gpu_state = new GpuState(); | 184 platform_display_init_params_.gpu_state = new GpuState(); |
| 180 | 185 |
| 181 // Gpu must be running before the PlatformScreen can be initialized. | 186 // Gpu must be running before the PlatformScreen can be initialized. |
| 182 platform_screen_->Init(); | 187 platform_screen_->Init(); |
| 183 window_server_.reset( | 188 window_server_.reset( |
| 184 new ws::WindowServer(this, platform_display_init_params_.surfaces_state)); | 189 new ws::WindowServer(this, platform_display_init_params_.surfaces_state)); |
| 185 } | 190 } |
| 186 | 191 |
| 187 bool MusApp::AcceptConnection(Connection* connection) { | 192 bool MusApp::AcceptConnection(Connection* connection) { |
| 188 connection->AddInterface<Gpu>(this); | 193 connection->AddInterface<Gpu>(this); |
| 189 connection->AddInterface<mojom::Clipboard>(this); | 194 connection->AddInterface<mojom::Clipboard>(this); |
| 190 connection->AddInterface<mojom::DisplayManager>(this); | 195 connection->AddInterface<mojom::DisplayManager>(this); |
| 191 connection->AddInterface<mojom::UserAccessManager>(this); | 196 connection->AddInterface<mojom::UserAccessManager>(this); |
| 192 connection->AddInterface<WindowTreeHostFactory>(this); | 197 connection->AddInterface<WindowTreeHostFactory>(this); |
| 193 connection->AddInterface<mojom::WindowManagerFactoryService>(this); | 198 connection->AddInterface<mojom::WindowManagerFactoryService>(this); |
| 194 connection->AddInterface<mojom::WindowTreeFactory>(this); | 199 connection->AddInterface<mojom::WindowTreeFactory>(this); |
| 195 if (test_config_) | 200 if (test_config_) |
| 196 connection->AddInterface<WindowServerTest>(this); | 201 connection->AddInterface<WindowServerTest>(this); |
| 202 |
| 203 input_device_server_.RegisterInterface(connection); |
| 204 |
| 197 return true; | 205 return true; |
| 198 } | 206 } |
| 199 | 207 |
| 200 void MusApp::OnFirstDisplayReady() { | 208 void MusApp::OnFirstDisplayReady() { |
| 201 PendingRequests requests; | 209 PendingRequests requests; |
| 202 requests.swap(pending_requests_); | 210 requests.swap(pending_requests_); |
| 203 for (auto& request : requests) | 211 for (auto& request : requests) |
| 204 Create(request->connection, std::move(*request->wtf_request)); | 212 Create(request->connection, std::move(*request->wtf_request)); |
| 205 } | 213 } |
| 206 | 214 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 platform_display_init_params_.display_bounds = bounds; | 301 platform_display_init_params_.display_bounds = bounds; |
| 294 platform_display_init_params_.display_id = id; | 302 platform_display_init_params_.display_id = id; |
| 295 | 303 |
| 296 // Display manages its own lifetime. | 304 // Display manages its own lifetime. |
| 297 ws::Display* host_impl = | 305 ws::Display* host_impl = |
| 298 new ws::Display(window_server_.get(), platform_display_init_params_); | 306 new ws::Display(window_server_.get(), platform_display_init_params_); |
| 299 host_impl->Init(nullptr); | 307 host_impl->Init(nullptr); |
| 300 } | 308 } |
| 301 | 309 |
| 302 } // namespace mus | 310 } // namespace mus |
| OLD | NEW |