| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 return it->second.get(); | 128 return it->second.get(); |
| 129 user_id_to_user_state_[user_id] = base::WrapUnique(new UserState); | 129 user_id_to_user_state_[user_id] = base::WrapUnique(new UserState); |
| 130 return user_id_to_user_state_[user_id].get(); | 130 return user_id_to_user_state_[user_id].get(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void Service::AddUserIfNecessary( | 133 void Service::AddUserIfNecessary( |
| 134 const service_manager::Identity& remote_identity) { | 134 const service_manager::Identity& remote_identity) { |
| 135 window_server_->user_id_tracker()->AddUserId(remote_identity.user_id()); | 135 window_server_->user_id_tracker()->AddUserId(remote_identity.user_id()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void Service::OnStart(const service_manager::Identity& identity) { | 138 void Service::OnStart(const service_manager::ServiceInfo& info) { |
| 139 base::PlatformThread::SetName("mus"); | 139 base::PlatformThread::SetName("mus"); |
| 140 tracing_.Initialize(connector(), identity.name()); | 140 tracing_.Initialize(connector(), info.identity.name()); |
| 141 TRACE_EVENT0("mus", "Service::Initialize started"); | 141 TRACE_EVENT0("mus", "Service::Initialize started"); |
| 142 | 142 |
| 143 test_config_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 143 test_config_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 144 switches::kUseTestConfig); | 144 switches::kUseTestConfig); |
| 145 #if defined(USE_X11) | 145 #if defined(USE_X11) |
| 146 XInitThreads(); | 146 XInitThreads(); |
| 147 if (test_config_) | 147 if (test_config_) |
| 148 ui::test::SetUseOverrideRedirectWindowByDefault(true); | 148 ui::test::SetUseOverrideRedirectWindowByDefault(true); |
| 149 #endif | 149 #endif |
| 150 | 150 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 // DeviceDataManager must be initialized before TouchController. On non-Linux | 188 // DeviceDataManager must be initialized before TouchController. On non-Linux |
| 189 // platforms there is no DeviceDataManager so don't create touch controller. | 189 // platforms there is no DeviceDataManager so don't create touch controller. |
| 190 if (ui::DeviceDataManager::HasInstance()) | 190 if (ui::DeviceDataManager::HasInstance()) |
| 191 touch_controller_.reset( | 191 touch_controller_.reset( |
| 192 new ws::TouchController(window_server_->display_manager())); | 192 new ws::TouchController(window_server_->display_manager())); |
| 193 | 193 |
| 194 ime_server_.Init(connector()); | 194 ime_server_.Init(connector()); |
| 195 } | 195 } |
| 196 | 196 |
| 197 bool Service::OnConnect(const service_manager::Identity& remote_identity, | 197 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info, |
| 198 service_manager::InterfaceRegistry* registry) { | 198 service_manager::InterfaceRegistry* registry) { |
| 199 registry->AddInterface<mojom::AccessibilityManager>(this); | 199 registry->AddInterface<mojom::AccessibilityManager>(this); |
| 200 registry->AddInterface<mojom::Clipboard>(this); | 200 registry->AddInterface<mojom::Clipboard>(this); |
| 201 registry->AddInterface<mojom::DisplayManager>(this); | 201 registry->AddInterface<mojom::DisplayManager>(this); |
| 202 registry->AddInterface<mojom::GpuService>(this); | 202 registry->AddInterface<mojom::GpuService>(this); |
| 203 registry->AddInterface<mojom::IMERegistrar>(this); | 203 registry->AddInterface<mojom::IMERegistrar>(this); |
| 204 registry->AddInterface<mojom::IMEServer>(this); | 204 registry->AddInterface<mojom::IMEServer>(this); |
| 205 registry->AddInterface<mojom::UserAccessManager>(this); | 205 registry->AddInterface<mojom::UserAccessManager>(this); |
| 206 registry->AddInterface<mojom::UserActivityMonitor>(this); | 206 registry->AddInterface<mojom::UserActivityMonitor>(this); |
| 207 registry->AddInterface<WindowTreeHostFactory>(this); | 207 registry->AddInterface<WindowTreeHostFactory>(this); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 mojom::WindowServerTestRequest request) { | 360 mojom::WindowServerTestRequest request) { |
| 361 if (!test_config_) | 361 if (!test_config_) |
| 362 return; | 362 return; |
| 363 mojo::MakeStrongBinding( | 363 mojo::MakeStrongBinding( |
| 364 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), | 364 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), |
| 365 std::move(request)); | 365 std::move(request)); |
| 366 } | 366 } |
| 367 | 367 |
| 368 | 368 |
| 369 } // namespace ui | 369 } // namespace ui |
| OLD | NEW |