| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 window_server_.reset( | 187 window_server_.reset( |
| 188 new ws::WindowServer(this, platform_display_init_params_.surfaces_state)); | 188 new ws::WindowServer(this, platform_display_init_params_.surfaces_state)); |
| 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 | 196 |
| 197 bool Service::OnConnect(Connection* connection) { | 197 bool Service::OnConnect(const shell::Identity& remote_identity, |
| 198 connection->AddInterface<mojom::AccessibilityManager>(this); | 198 shell::InterfaceRegistry* registry) { |
| 199 connection->AddInterface<mojom::Clipboard>(this); | 199 registry->AddInterface<mojom::AccessibilityManager>(this); |
| 200 connection->AddInterface<mojom::DisplayManager>(this); | 200 registry->AddInterface<mojom::Clipboard>(this); |
| 201 connection->AddInterface<mojom::GpuService>(this); | 201 registry->AddInterface<mojom::DisplayManager>(this); |
| 202 connection->AddInterface<mojom::UserAccessManager>(this); | 202 registry->AddInterface<mojom::GpuService>(this); |
| 203 connection->AddInterface<mojom::UserActivityMonitor>(this); | 203 registry->AddInterface<mojom::UserAccessManager>(this); |
| 204 connection->AddInterface<WindowTreeHostFactory>(this); | 204 registry->AddInterface<mojom::UserActivityMonitor>(this); |
| 205 connection->AddInterface<mojom::WindowManagerWindowTreeFactory>(this); | 205 registry->AddInterface<WindowTreeHostFactory>(this); |
| 206 connection->AddInterface<mojom::WindowTreeFactory>(this); | 206 registry->AddInterface<mojom::WindowManagerWindowTreeFactory>(this); |
| 207 registry->AddInterface<mojom::WindowTreeFactory>(this); |
| 207 if (test_config_) | 208 if (test_config_) |
| 208 connection->AddInterface<WindowServerTest>(this); | 209 registry->AddInterface<WindowServerTest>(this); |
| 209 | 210 |
| 210 // On non-Linux platforms there will be no DeviceDataManager instance and no | 211 // On non-Linux platforms there will be no DeviceDataManager instance and no |
| 211 // purpose in adding the Mojo interface to connect to. | 212 // purpose in adding the Mojo interface to connect to. |
| 212 if (input_device_server_.IsRegisteredAsObserver()) | 213 if (input_device_server_.IsRegisteredAsObserver()) |
| 213 input_device_server_.AddInterface(connection); | 214 input_device_server_.AddInterface(registry); |
| 214 | 215 |
| 215 #if defined(USE_OZONE) | 216 #if defined(USE_OZONE) |
| 216 ui::OzonePlatform::GetInstance()->AddInterfaces(connection); | 217 ui::OzonePlatform::GetInstance()->AddInterfaces(registry); |
| 217 #endif | 218 #endif |
| 218 | 219 |
| 219 return true; | 220 return true; |
| 220 } | 221 } |
| 221 | 222 |
| 222 void Service::OnFirstDisplayReady() { | 223 void Service::OnFirstDisplayReady() { |
| 223 PendingRequests requests; | 224 PendingRequests requests; |
| 224 requests.swap(pending_requests_); | 225 requests.swap(pending_requests_); |
| 225 for (auto& request : requests) { | 226 for (auto& request : requests) { |
| 226 if (request->wtf_request) | 227 if (request->wtf_request) |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // Display manages its own lifetime. | 347 // Display manages its own lifetime. |
| 347 ws::Display* host_impl = | 348 ws::Display* host_impl = |
| 348 new ws::Display(window_server_.get(), platform_display_init_params_); | 349 new ws::Display(window_server_.get(), platform_display_init_params_); |
| 349 host_impl->Init(nullptr); | 350 host_impl->Init(nullptr); |
| 350 | 351 |
| 351 if (touch_controller_) | 352 if (touch_controller_) |
| 352 touch_controller_->UpdateTouchTransforms(); | 353 touch_controller_->UpdateTouchTransforms(); |
| 353 } | 354 } |
| 354 | 355 |
| 355 } // namespace ui | 356 } // namespace ui |
| OLD | NEW |