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 "services/ui/service.h" | 5 #include "services/ui/service.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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 #if !defined(OS_ANDROID) | 172 #if !defined(OS_ANDROID) |
173 event_source_ = ui::PlatformEventSource::CreateDefault(); | 173 event_source_ = ui::PlatformEventSource::CreateDefault(); |
174 #endif | 174 #endif |
175 | 175 |
176 // This needs to happen after DeviceDataManager has been constructed. That | 176 // This needs to happen after DeviceDataManager has been constructed. That |
177 // happens either during OzonePlatform or PlatformEventSource initialization, | 177 // happens either during OzonePlatform or PlatformEventSource initialization, |
178 // so keep this line below both of those. | 178 // so keep this line below both of those. |
179 input_device_server_.RegisterAsObserver(); | 179 input_device_server_.RegisterAsObserver(); |
180 | 180 |
181 gpu_proxy_.reset(new GpuServiceProxy()); | |
182 | |
183 // Gpu must be running before the PlatformScreen can be initialized. | 181 // Gpu must be running before the PlatformScreen can be initialized. |
184 window_server_.reset(new ws::WindowServer(this)); | 182 window_server_.reset(new ws::WindowServer(this)); |
185 | 183 |
186 // DeviceDataManager must be initialized before TouchController. On non-Linux | 184 // DeviceDataManager must be initialized before TouchController. On non-Linux |
187 // platforms there is no DeviceDataManager so don't create touch controller. | 185 // platforms there is no DeviceDataManager so don't create touch controller. |
188 if (ui::DeviceDataManager::HasInstance()) | 186 if (ui::DeviceDataManager::HasInstance()) |
189 touch_controller_.reset( | 187 touch_controller_.reset( |
190 new ws::TouchController(window_server_->display_manager())); | 188 new ws::TouchController(window_server_->display_manager())); |
191 } | 189 } |
192 | 190 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 pending_requests_.push_back(std::move(pending_request)); | 276 pending_requests_.push_back(std::move(pending_request)); |
279 return; | 277 return; |
280 } | 278 } |
281 window_server_->display_manager() | 279 window_server_->display_manager() |
282 ->GetUserDisplayManager(remote_identity.user_id()) | 280 ->GetUserDisplayManager(remote_identity.user_id()) |
283 ->AddDisplayManagerBinding(std::move(request)); | 281 ->AddDisplayManagerBinding(std::move(request)); |
284 } | 282 } |
285 | 283 |
286 void Service::Create(const shell::Identity& remote_identity, | 284 void Service::Create(const shell::Identity& remote_identity, |
287 mojom::GpuServiceRequest request) { | 285 mojom::GpuServiceRequest request) { |
288 gpu_proxy_->Add(std::move(request)); | 286 window_server_->gpu_proxy()->Add(std::move(request)); |
289 } | 287 } |
290 | 288 |
291 void Service::Create(const shell::Identity& remote_identity, | 289 void Service::Create(const shell::Identity& remote_identity, |
292 mojom::IMERegistrarRequest request) { | 290 mojom::IMERegistrarRequest request) { |
293 ime_registrar_.AddBinding(std::move(request)); | 291 ime_registrar_.AddBinding(std::move(request)); |
294 } | 292 } |
295 | 293 |
296 void Service::Create(const shell::Identity& remote_identity, | 294 void Service::Create(const shell::Identity& remote_identity, |
297 mojom::IMEServerRequest request) { | 295 mojom::IMEServerRequest request) { |
298 ime_server_.AddBinding(std::move(request)); | 296 ime_server_.AddBinding(std::move(request)); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 344 |
347 void Service::Create(const shell::Identity& remote_identity, | 345 void Service::Create(const shell::Identity& remote_identity, |
348 mojom::WindowServerTestRequest request) { | 346 mojom::WindowServerTestRequest request) { |
349 if (!test_config_) | 347 if (!test_config_) |
350 return; | 348 return; |
351 new ws::WindowServerTestImpl(window_server_.get(), std::move(request)); | 349 new ws::WindowServerTestImpl(window_server_.get(), std::move(request)); |
352 } | 350 } |
353 | 351 |
354 | 352 |
355 } // namespace ui | 353 } // namespace ui |
OLD | NEW |