| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // happens either during OzonePlatform or PlatformEventSource initialization, | 188 // happens either during OzonePlatform or PlatformEventSource initialization, |
| 189 // so keep this line below both of those. | 189 // so keep this line below both of those. |
| 190 input_device_server_.RegisterAsObserver(); | 190 input_device_server_.RegisterAsObserver(); |
| 191 | 191 |
| 192 window_server_.reset(new ws::WindowServer(this)); | 192 window_server_.reset(new ws::WindowServer(this)); |
| 193 | 193 |
| 194 ime_server_.Init(context()->connector(), test_config_); | 194 ime_server_.Init(context()->connector(), test_config_); |
| 195 | 195 |
| 196 discardable_shared_memory_manager_ = | 196 discardable_shared_memory_manager_ = |
| 197 base::MakeUnique<discardable_memory::DiscardableSharedMemoryManager>(); | 197 base::MakeUnique<discardable_memory::DiscardableSharedMemoryManager>(); |
| 198 } | |
| 199 | 198 |
| 200 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info, | 199 registry_.AddInterface<mojom::AccessibilityManager>(this); |
| 201 service_manager::InterfaceRegistry* registry) { | 200 registry_.AddInterface<mojom::Clipboard>(this); |
| 202 registry->AddInterface<mojom::AccessibilityManager>(this); | 201 registry_.AddInterface<mojom::DisplayManager>(this); |
| 203 registry->AddInterface<mojom::Clipboard>(this); | 202 registry_.AddInterface<mojom::Gpu>(this); |
| 204 registry->AddInterface<mojom::DisplayManager>(this); | 203 registry_.AddInterface<mojom::IMERegistrar>(this); |
| 205 registry->AddInterface<mojom::Gpu>(this); | 204 registry_.AddInterface<mojom::IMEServer>(this); |
| 206 registry->AddInterface<mojom::IMERegistrar>(this); | 205 registry_.AddInterface<mojom::UserAccessManager>(this); |
| 207 registry->AddInterface<mojom::IMEServer>(this); | 206 registry_.AddInterface<mojom::UserActivityMonitor>(this); |
| 208 registry->AddInterface<mojom::UserAccessManager>(this); | 207 registry_.AddInterface<WindowTreeHostFactory>(this); |
| 209 registry->AddInterface<mojom::UserActivityMonitor>(this); | 208 registry_.AddInterface<mojom::WindowManagerWindowTreeFactory>(this); |
| 210 registry->AddInterface<WindowTreeHostFactory>(this); | 209 registry_.AddInterface<mojom::WindowTreeFactory>(this); |
| 211 registry->AddInterface<mojom::WindowManagerWindowTreeFactory>(this); | 210 registry_ |
| 212 registry->AddInterface<mojom::WindowTreeFactory>(this); | 211 .AddInterface<discardable_memory::mojom::DiscardableSharedMemoryManager>( |
| 213 registry | |
| 214 ->AddInterface<discardable_memory::mojom::DiscardableSharedMemoryManager>( | |
| 215 this); | 212 this); |
| 216 if (test_config_) | 213 if (test_config_) |
| 217 registry->AddInterface<WindowServerTest>(this); | 214 registry_.AddInterface<WindowServerTest>(this); |
| 218 | 215 |
| 219 // On non-Linux platforms there will be no DeviceDataManager instance and no | 216 // On non-Linux platforms there will be no DeviceDataManager instance and no |
| 220 // purpose in adding the Mojo interface to connect to. | 217 // purpose in adding the Mojo interface to connect to. |
| 221 if (input_device_server_.IsRegisteredAsObserver()) | 218 if (input_device_server_.IsRegisteredAsObserver()) |
| 222 input_device_server_.AddInterface(registry); | 219 input_device_server_.AddInterface(®istry_); |
| 223 | 220 |
| 224 screen_manager_->AddInterfaces(registry); | 221 screen_manager_->AddInterfaces(®istry_); |
| 225 | 222 |
| 226 #if defined(USE_OZONE) | 223 #if defined(USE_OZONE) |
| 227 ui::OzonePlatform::GetInstance()->AddInterfaces(registry); | 224 ui::OzonePlatform::GetInstance()->AddInterfaces(®istry_); |
| 228 #endif | 225 #endif |
| 226 } |
| 229 | 227 |
| 230 return true; | 228 void Service::OnBindInterface(const service_manager::ServiceInfo& source_info, |
| 229 const std::string& interface_name, |
| 230 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 231 registry_.BindInterface(source_info.identity, interface_name, |
| 232 std::move(interface_pipe)); |
| 231 } | 233 } |
| 232 | 234 |
| 233 void Service::StartDisplayInit() { | 235 void Service::StartDisplayInit() { |
| 234 screen_manager_->Init(window_server_->display_manager()); | 236 screen_manager_->Init(window_server_->display_manager()); |
| 235 } | 237 } |
| 236 | 238 |
| 237 void Service::OnFirstDisplayReady() { | 239 void Service::OnFirstDisplayReady() { |
| 238 PendingRequests requests; | 240 PendingRequests requests; |
| 239 requests.swap(pending_requests_); | 241 requests.swap(pending_requests_); |
| 240 for (auto& request : requests) { | 242 for (auto& request : requests) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 mojom::WindowServerTestRequest request) { | 367 mojom::WindowServerTestRequest request) { |
| 366 if (!test_config_) | 368 if (!test_config_) |
| 367 return; | 369 return; |
| 368 mojo::MakeStrongBinding( | 370 mojo::MakeStrongBinding( |
| 369 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), | 371 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), |
| 370 std::move(request)); | 372 std::move(request)); |
| 371 } | 373 } |
| 372 | 374 |
| 373 | 375 |
| 374 } // namespace ui | 376 } // namespace ui |
| OLD | NEW |