| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 // Gpu must be running before the PlatformScreen can be initialized. | 187 // Gpu must be running before the PlatformScreen can be initialized. |
| 188 window_server_.reset(new ws::WindowServer(this)); | 188 window_server_.reset(new ws::WindowServer(this)); |
| 189 | 189 |
| 190 // DeviceDataManager must be initialized before TouchController. On non-Linux | 190 // DeviceDataManager must be initialized before TouchController. On non-Linux |
| 191 // platforms there is no DeviceDataManager so don't create touch controller. | 191 // platforms there is no DeviceDataManager so don't create touch controller. |
| 192 if (ui::DeviceDataManager::HasInstance()) | 192 if (ui::DeviceDataManager::HasInstance()) |
| 193 touch_controller_.reset( | 193 touch_controller_.reset( |
| 194 new ws::TouchController(window_server_->display_manager())); | 194 new ws::TouchController(window_server_->display_manager())); |
| 195 | 195 |
| 196 platform_screen_->Init(window_server_->display_manager()); |
| 197 |
| 196 ime_server_.Init(context->connector()); | 198 ime_server_.Init(context->connector()); |
| 197 } | 199 } |
| 198 | 200 |
| 199 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info, | 201 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info, |
| 200 service_manager::InterfaceRegistry* registry) { | 202 service_manager::InterfaceRegistry* registry) { |
| 201 registry->AddInterface<mojom::AccessibilityManager>(this); | 203 registry->AddInterface<mojom::AccessibilityManager>(this); |
| 202 registry->AddInterface<mojom::Clipboard>(this); | 204 registry->AddInterface<mojom::Clipboard>(this); |
| 203 registry->AddInterface<mojom::DisplayManager>(this); | 205 registry->AddInterface<mojom::DisplayManager>(this); |
| 204 registry->AddInterface<mojom::GpuService>(this); | 206 registry->AddInterface<mojom::GpuService>(this); |
| 205 registry->AddInterface<mojom::IMERegistrar>(this); | 207 registry->AddInterface<mojom::IMERegistrar>(this); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 249 |
| 248 bool Service::IsTestConfig() const { | 250 bool Service::IsTestConfig() const { |
| 249 return test_config_; | 251 return test_config_; |
| 250 } | 252 } |
| 251 | 253 |
| 252 void Service::UpdateTouchTransforms() { | 254 void Service::UpdateTouchTransforms() { |
| 253 if (touch_controller_) | 255 if (touch_controller_) |
| 254 touch_controller_->UpdateTouchTransforms(); | 256 touch_controller_->UpdateTouchTransforms(); |
| 255 } | 257 } |
| 256 | 258 |
| 257 void Service::CreateDefaultDisplays() { | |
| 258 // The display manager will create Displays once hardware or virtual displays | |
| 259 // are ready. | |
| 260 platform_screen_->Init(window_server_->display_manager()); | |
| 261 } | |
| 262 | |
| 263 void Service::Create(const service_manager::Identity& remote_identity, | 259 void Service::Create(const service_manager::Identity& remote_identity, |
| 264 mojom::AccessibilityManagerRequest request) { | 260 mojom::AccessibilityManagerRequest request) { |
| 265 UserState* user_state = GetUserState(remote_identity); | 261 UserState* user_state = GetUserState(remote_identity); |
| 266 if (!user_state->accessibility) { | 262 if (!user_state->accessibility) { |
| 267 const ws::UserId& user_id = remote_identity.user_id(); | 263 const ws::UserId& user_id = remote_identity.user_id(); |
| 268 user_state->accessibility.reset( | 264 user_state->accessibility.reset( |
| 269 new ws::AccessibilityManager(window_server_.get(), user_id)); | 265 new ws::AccessibilityManager(window_server_.get(), user_id)); |
| 270 } | 266 } |
| 271 user_state->accessibility->Bind(std::move(request)); | 267 user_state->accessibility->Bind(std::move(request)); |
| 272 } | 268 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 mojom::WindowServerTestRequest request) { | 358 mojom::WindowServerTestRequest request) { |
| 363 if (!test_config_) | 359 if (!test_config_) |
| 364 return; | 360 return; |
| 365 mojo::MakeStrongBinding( | 361 mojo::MakeStrongBinding( |
| 366 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), | 362 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), |
| 367 std::move(request)); | 363 std::move(request)); |
| 368 } | 364 } |
| 369 | 365 |
| 370 | 366 |
| 371 } // namespace ui | 367 } // namespace ui |
| OLD | NEW |