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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "services/ui/ws/window_tree_host_factory.h" | 42 #include "services/ui/ws/window_tree_host_factory.h" |
43 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
44 #include "ui/base/ui_base_paths.h" | 44 #include "ui/base/ui_base_paths.h" |
45 #include "ui/events/event_switches.h" | 45 #include "ui/events/event_switches.h" |
46 #include "ui/events/platform/platform_event_source.h" | 46 #include "ui/events/platform/platform_event_source.h" |
47 #include "ui/gfx/geometry/rect.h" | 47 #include "ui/gfx/geometry/rect.h" |
48 #include "ui/gl/gl_surface.h" | 48 #include "ui/gl/gl_surface.h" |
49 | 49 |
50 #if defined(USE_X11) | 50 #if defined(USE_X11) |
51 #include <X11/Xlib.h> | 51 #include <X11/Xlib.h> |
| 52 #include "ui/base/x/x11_util.h" // nogncheck |
52 #include "ui/platform_window/x11/x11_window.h" | 53 #include "ui/platform_window/x11/x11_window.h" |
53 #elif defined(USE_OZONE) | 54 #elif defined(USE_OZONE) |
54 #include "ui/events/ozone/layout/keyboard_layout_engine.h" | 55 #include "ui/events/ozone/layout/keyboard_layout_engine.h" |
55 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" | 56 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" |
56 #include "ui/ozone/public/ozone_platform.h" | 57 #include "ui/ozone/public/ozone_platform.h" |
57 #endif | 58 #endif |
58 | 59 |
59 using service_manager::Connection; | 60 using service_manager::Connection; |
60 using mojo::InterfaceRequest; | 61 using mojo::InterfaceRequest; |
61 using ui::mojom::WindowServerTest; | 62 using ui::mojom::WindowServerTest; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 base::PlatformThread::SetName("mus"); | 143 base::PlatformThread::SetName("mus"); |
143 tracing_.Initialize(context()->connector(), context()->identity().name()); | 144 tracing_.Initialize(context()->connector(), context()->identity().name()); |
144 TRACE_EVENT0("mus", "Service::Initialize started"); | 145 TRACE_EVENT0("mus", "Service::Initialize started"); |
145 | 146 |
146 test_config_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 147 test_config_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
147 switches::kUseTestConfig); | 148 switches::kUseTestConfig); |
148 #if defined(USE_X11) | 149 #if defined(USE_X11) |
149 XInitThreads(); | 150 XInitThreads(); |
150 if (test_config_) | 151 if (test_config_) |
151 ui::test::SetUseOverrideRedirectWindowByDefault(true); | 152 ui::test::SetUseOverrideRedirectWindowByDefault(true); |
| 153 ui::SetDefaultX11ErrorHandlers(); |
152 #endif | 154 #endif |
153 | 155 |
154 InitializeResources(context()->connector()); | 156 InitializeResources(context()->connector()); |
155 | 157 |
156 #if defined(USE_OZONE) | 158 #if defined(USE_OZONE) |
157 // 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 |
158 // platform before creating the default event source. | 160 // platform before creating the default event source. |
159 // Because GL libraries need to be initialized before entering the sandbox, | 161 // Because GL libraries need to be initialized before entering the sandbox, |
160 // in MUS, |InitializeForUI| will load the GL libraries. | 162 // in MUS, |InitializeForUI| will load the GL libraries. |
161 ui::OzonePlatform::InitParams params; | 163 ui::OzonePlatform::InitParams params; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 mojom::WindowServerTestRequest request) { | 363 mojom::WindowServerTestRequest request) { |
362 if (!test_config_) | 364 if (!test_config_) |
363 return; | 365 return; |
364 mojo::MakeStrongBinding( | 366 mojo::MakeStrongBinding( |
365 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), | 367 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), |
366 std::move(request)); | 368 std::move(request)); |
367 } | 369 } |
368 | 370 |
369 | 371 |
370 } // namespace ui | 372 } // namespace ui |
OLD | NEW |