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 "components/mus/mus_app.h" | 5 #include "components/mus/mus_app.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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 XInitThreads(); | 151 XInitThreads(); |
152 if (test_config_) | 152 if (test_config_) |
153 ui::test::SetUseOverrideRedirectWindowByDefault(true); | 153 ui::test::SetUseOverrideRedirectWindowByDefault(true); |
154 #endif | 154 #endif |
155 | 155 |
156 InitializeResources(connector); | 156 InitializeResources(connector); |
157 | 157 |
158 #if defined(USE_OZONE) | 158 #if defined(USE_OZONE) |
159 // The ozone platform can provide its own event source. So initialize the | 159 // The ozone platform can provide its own event source. So initialize the |
160 // platform before creating the default event source. | 160 // platform before creating the default event source. |
161 // TODO(rjkroege): Add tracing here. | |
162 // Because GL libraries need to be initialized before entering the sandbox, | 161 // Because GL libraries need to be initialized before entering the sandbox, |
163 // in MUS, |InitializeForUI| will load the GL libraries. | 162 // in MUS, |InitializeForUI| will load the GL libraries. |
164 ui::OzonePlatform::InitializeForUI(); | 163 ui::OzonePlatform::InitParams params; |
| 164 params.connector = connector; |
| 165 params.single_process = false; |
| 166 |
| 167 ui::OzonePlatform::InitializeForUI(params); |
165 | 168 |
166 // TODO(kylechar): We might not always want a US keyboard layout. | 169 // TODO(kylechar): We might not always want a US keyboard layout. |
167 ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine() | 170 ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine() |
168 ->SetCurrentLayoutByName("us"); | 171 ->SetCurrentLayoutByName("us"); |
169 client_native_pixmap_factory_ = ui::ClientNativePixmapFactory::Create(); | 172 client_native_pixmap_factory_ = ui::ClientNativePixmapFactory::Create(); |
170 ui::ClientNativePixmapFactory::SetInstance( | 173 ui::ClientNativePixmapFactory::SetInstance( |
171 client_native_pixmap_factory_.get()); | 174 client_native_pixmap_factory_.get()); |
172 | 175 |
173 DCHECK(ui::ClientNativePixmapFactory::GetInstance()); | 176 DCHECK(ui::ClientNativePixmapFactory::GetInstance()); |
174 #endif | 177 #endif |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 connection->AddInterface<mojom::GpuService>(this); | 216 connection->AddInterface<mojom::GpuService>(this); |
214 } else { | 217 } else { |
215 connection->AddInterface<Gpu>(this); | 218 connection->AddInterface<Gpu>(this); |
216 } | 219 } |
217 | 220 |
218 // On non-Linux platforms there will be no DeviceDataManager instance and no | 221 // On non-Linux platforms there will be no DeviceDataManager instance and no |
219 // purpose in adding the Mojo interface to connect to. | 222 // purpose in adding the Mojo interface to connect to. |
220 if (input_device_server_.IsRegisteredAsObserver()) | 223 if (input_device_server_.IsRegisteredAsObserver()) |
221 input_device_server_.AddInterface(connection); | 224 input_device_server_.AddInterface(connection); |
222 | 225 |
| 226 #if defined(USE_OZONE) |
| 227 ui::OzonePlatform::GetInstance()->AddInterfaces(connection); |
| 228 #endif |
| 229 |
223 return true; | 230 return true; |
224 } | 231 } |
225 | 232 |
226 void MusApp::OnFirstDisplayReady() { | 233 void MusApp::OnFirstDisplayReady() { |
227 PendingRequests requests; | 234 PendingRequests requests; |
228 requests.swap(pending_requests_); | 235 requests.swap(pending_requests_); |
229 for (auto& request : requests) | 236 for (auto& request : requests) |
230 Create(request->connection, std::move(*request->wtf_request)); | 237 Create(request->connection, std::move(*request->wtf_request)); |
231 } | 238 } |
232 | 239 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 platform_display_init_params_.display_bounds = bounds; | 335 platform_display_init_params_.display_bounds = bounds; |
329 platform_display_init_params_.display_id = id; | 336 platform_display_init_params_.display_id = id; |
330 | 337 |
331 // Display manages its own lifetime. | 338 // Display manages its own lifetime. |
332 ws::Display* host_impl = | 339 ws::Display* host_impl = |
333 new ws::Display(window_server_.get(), platform_display_init_params_); | 340 new ws::Display(window_server_.get(), platform_display_init_params_); |
334 host_impl->Init(nullptr); | 341 host_impl->Init(nullptr); |
335 } | 342 } |
336 | 343 |
337 } // namespace mus | 344 } // namespace mus |
OLD | NEW |