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" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "services/catalog/public/cpp/resource_loader.h" | 15 #include "services/catalog/public/cpp/resource_loader.h" |
16 #include "services/shell/public/c/main.h" | 16 #include "services/shell/public/c/main.h" |
17 #include "services/shell/public/cpp/connection.h" | 17 #include "services/shell/public/cpp/connection.h" |
18 #include "services/shell/public/cpp/connector.h" | 18 #include "services/shell/public/cpp/connector.h" |
19 #include "services/tracing/public/cpp/provider.h" | 19 #include "services/tracing/public/cpp/provider.h" |
20 #include "services/ui/clipboard/clipboard_impl.h" | 20 #include "services/ui/clipboard/clipboard_impl.h" |
21 #include "services/ui/common/switches.h" | 21 #include "services/ui/common/switches.h" |
22 #include "services/ui/display/platform_screen.h" | 22 #include "services/ui/display/platform_screen.h" |
23 #include "services/ui/gpu/gpu_service_impl.h" | |
24 #include "services/ui/gpu/gpu_service_mus.h" | |
25 #include "services/ui/ime/ime_registrar_impl.h" | 23 #include "services/ui/ime/ime_registrar_impl.h" |
26 #include "services/ui/ime/ime_server_impl.h" | 24 #include "services/ui/ime/ime_server_impl.h" |
27 #include "services/ui/ws/accessibility_manager.h" | 25 #include "services/ui/ws/accessibility_manager.h" |
28 #include "services/ui/ws/display.h" | 26 #include "services/ui/ws/display.h" |
29 #include "services/ui/ws/display_binding.h" | 27 #include "services/ui/ws/display_binding.h" |
30 #include "services/ui/ws/display_manager.h" | 28 #include "services/ui/ws/display_manager.h" |
| 29 #include "services/ui/ws/gpu_service_proxy.h" |
31 #include "services/ui/ws/user_activity_monitor.h" | 30 #include "services/ui/ws/user_activity_monitor.h" |
32 #include "services/ui/ws/user_display_manager.h" | 31 #include "services/ui/ws/user_display_manager.h" |
33 #include "services/ui/ws/window_server.h" | 32 #include "services/ui/ws/window_server.h" |
34 #include "services/ui/ws/window_server_test_impl.h" | 33 #include "services/ui/ws/window_server_test_impl.h" |
35 #include "services/ui/ws/window_tree.h" | 34 #include "services/ui/ws/window_tree.h" |
36 #include "services/ui/ws/window_tree_binding.h" | 35 #include "services/ui/ws/window_tree_binding.h" |
37 #include "services/ui/ws/window_tree_factory.h" | 36 #include "services/ui/ws/window_tree_factory.h" |
38 #include "services/ui/ws/window_tree_host_factory.h" | 37 #include "services/ui/ws/window_tree_host_factory.h" |
39 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
40 #include "ui/base/ui_base_paths.h" | 39 #include "ui/base/ui_base_paths.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 174 |
176 #if !defined(OS_ANDROID) | 175 #if !defined(OS_ANDROID) |
177 event_source_ = ui::PlatformEventSource::CreateDefault(); | 176 event_source_ = ui::PlatformEventSource::CreateDefault(); |
178 #endif | 177 #endif |
179 | 178 |
180 // This needs to happen after DeviceDataManager has been constructed. That | 179 // This needs to happen after DeviceDataManager has been constructed. That |
181 // happens either during OzonePlatform or PlatformEventSource initialization, | 180 // happens either during OzonePlatform or PlatformEventSource initialization, |
182 // so keep this line below both of those. | 181 // so keep this line below both of those. |
183 input_device_server_.RegisterAsObserver(); | 182 input_device_server_.RegisterAsObserver(); |
184 | 183 |
185 GpuServiceMus::GetInstance(); | 184 gpu_proxy_.reset(new GpuServiceProxy()); |
186 | 185 |
187 // Gpu must be running before the PlatformScreen can be initialized. | 186 // Gpu must be running before the PlatformScreen can be initialized. |
188 platform_screen_->Init(); | 187 platform_screen_->Init(); |
189 window_server_.reset( | 188 window_server_.reset( |
190 new ws::WindowServer(this, platform_display_init_params_.surfaces_state)); | 189 new ws::WindowServer(this, platform_display_init_params_.surfaces_state)); |
191 | 190 |
192 // DeviceDataManager must be initialized before TouchController. On non-Linux | 191 // DeviceDataManager must be initialized before TouchController. On non-Linux |
193 // platforms there is no DeviceDataManager so don't create touch controller. | 192 // platforms there is no DeviceDataManager so don't create touch controller. |
194 if (ui::DeviceDataManager::HasInstance()) | 193 if (ui::DeviceDataManager::HasInstance()) |
195 touch_controller_.reset( | 194 touch_controller_.reset( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 pending_requests_.push_back(std::move(pending_request)); | 279 pending_requests_.push_back(std::move(pending_request)); |
281 return; | 280 return; |
282 } | 281 } |
283 window_server_->display_manager() | 282 window_server_->display_manager() |
284 ->GetUserDisplayManager(remote_identity.user_id()) | 283 ->GetUserDisplayManager(remote_identity.user_id()) |
285 ->AddDisplayManagerBinding(std::move(request)); | 284 ->AddDisplayManagerBinding(std::move(request)); |
286 } | 285 } |
287 | 286 |
288 void Service::Create(const shell::Identity& remote_identity, | 287 void Service::Create(const shell::Identity& remote_identity, |
289 mojom::GpuServiceRequest request) { | 288 mojom::GpuServiceRequest request) { |
290 new GpuServiceImpl(std::move(request)); | 289 gpu_proxy_->Add(std::move(request)); |
291 } | 290 } |
292 | 291 |
293 void Service::Create(const shell::Identity& remote_identity, | 292 void Service::Create(const shell::Identity& remote_identity, |
294 mojom::IMERegistrarRequest request) { | 293 mojom::IMERegistrarRequest request) { |
295 ime_registrar_.AddBinding(std::move(request)); | 294 ime_registrar_.AddBinding(std::move(request)); |
296 } | 295 } |
297 | 296 |
298 void Service::Create(const shell::Identity& remote_identity, | 297 void Service::Create(const shell::Identity& remote_identity, |
299 mojom::IMEServerRequest request) { | 298 mojom::IMEServerRequest request) { |
300 ime_server_.AddBinding(std::move(request)); | 299 ime_server_.AddBinding(std::move(request)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // Display manages its own lifetime. | 361 // Display manages its own lifetime. |
363 ws::Display* host_impl = | 362 ws::Display* host_impl = |
364 new ws::Display(window_server_.get(), platform_display_init_params_); | 363 new ws::Display(window_server_.get(), platform_display_init_params_); |
365 host_impl->Init(nullptr); | 364 host_impl->Init(nullptr); |
366 | 365 |
367 if (touch_controller_) | 366 if (touch_controller_) |
368 touch_controller_->UpdateTouchTransforms(); | 367 touch_controller_->UpdateTouchTransforms(); |
369 } | 368 } |
370 | 369 |
371 } // namespace ui | 370 } // namespace ui |
OLD | NEW |