| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 InitializeResources(connector); | 149 InitializeResources(connector); |
| 150 | 150 |
| 151 #if defined(USE_OZONE) | 151 #if defined(USE_OZONE) |
| 152 // The ozone platform can provide its own event source. So initialize the | 152 // The ozone platform can provide its own event source. So initialize the |
| 153 // platform before creating the default event source. | 153 // platform before creating the default event source. |
| 154 // TODO(rjkroege): Add tracing here. | 154 // TODO(rjkroege): Add tracing here. |
| 155 // Because GL libraries need to be initialized before entering the sandbox, | 155 // Because GL libraries need to be initialized before entering the sandbox, |
| 156 // in MUS, |InitializeForUI| will load the GL libraries. | 156 // in MUS, |InitializeForUI| will load the GL libraries. |
| 157 ui::OzonePlatform::InitializeForUI(); | 157 ui::OzonePlatform::InitializeForUI(); |
| 158 | 158 |
| 159 input_device_server_.RegisterAsObserver(); |
| 160 |
| 159 // TODO(kylechar): We might not always want a US keyboard layout. | 161 // TODO(kylechar): We might not always want a US keyboard layout. |
| 160 ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine() | 162 ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine() |
| 161 ->SetCurrentLayoutByName("us"); | 163 ->SetCurrentLayoutByName("us"); |
| 162 client_native_pixmap_factory_ = ui::ClientNativePixmapFactory::Create(); | 164 client_native_pixmap_factory_ = ui::ClientNativePixmapFactory::Create(); |
| 163 ui::ClientNativePixmapFactory::SetInstance( | 165 ui::ClientNativePixmapFactory::SetInstance( |
| 164 client_native_pixmap_factory_.get()); | 166 client_native_pixmap_factory_.get()); |
| 165 | 167 |
| 166 DCHECK(ui::ClientNativePixmapFactory::GetInstance()); | 168 DCHECK(ui::ClientNativePixmapFactory::GetInstance()); |
| 167 #endif | 169 #endif |
| 168 | 170 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 185 | 187 |
| 186 bool MusApp::AcceptConnection(Connection* connection) { | 188 bool MusApp::AcceptConnection(Connection* connection) { |
| 187 connection->AddInterface<Gpu>(this); | 189 connection->AddInterface<Gpu>(this); |
| 188 connection->AddInterface<mojom::DisplayManager>(this); | 190 connection->AddInterface<mojom::DisplayManager>(this); |
| 189 connection->AddInterface<mojom::UserAccessManager>(this); | 191 connection->AddInterface<mojom::UserAccessManager>(this); |
| 190 connection->AddInterface<WindowTreeHostFactory>(this); | 192 connection->AddInterface<WindowTreeHostFactory>(this); |
| 191 connection->AddInterface<mojom::WindowManagerFactoryService>(this); | 193 connection->AddInterface<mojom::WindowManagerFactoryService>(this); |
| 192 connection->AddInterface<mojom::WindowTreeFactory>(this); | 194 connection->AddInterface<mojom::WindowTreeFactory>(this); |
| 193 if (test_config_) | 195 if (test_config_) |
| 194 connection->AddInterface<WindowServerTest>(this); | 196 connection->AddInterface<WindowServerTest>(this); |
| 197 |
| 198 input_device_server_.RegisterInterface(connection); |
| 199 |
| 195 return true; | 200 return true; |
| 196 } | 201 } |
| 197 | 202 |
| 198 void MusApp::OnFirstDisplayReady() { | 203 void MusApp::OnFirstDisplayReady() { |
| 199 PendingRequests requests; | 204 PendingRequests requests; |
| 200 requests.swap(pending_requests_); | 205 requests.swap(pending_requests_); |
| 201 for (auto& request : requests) | 206 for (auto& request : requests) |
| 202 Create(request->connection, std::move(*request->wtf_request)); | 207 Create(request->connection, std::move(*request->wtf_request)); |
| 203 } | 208 } |
| 204 | 209 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 platform_display_init_params_.display_bounds = bounds; | 288 platform_display_init_params_.display_bounds = bounds; |
| 284 platform_display_init_params_.display_id = id; | 289 platform_display_init_params_.display_id = id; |
| 285 | 290 |
| 286 // Display manages its own lifetime. | 291 // Display manages its own lifetime. |
| 287 ws::Display* host_impl = | 292 ws::Display* host_impl = |
| 288 new ws::Display(window_server_.get(), platform_display_init_params_); | 293 new ws::Display(window_server_.get(), platform_display_init_params_); |
| 289 host_impl->Init(nullptr); | 294 host_impl->Init(nullptr); |
| 290 } | 295 } |
| 291 | 296 |
| 292 } // namespace mus | 297 } // namespace mus |
| OLD | NEW |