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 22 matching lines...) Expand all Loading... |
33 #include "services/ui/ws/display_manager.h" | 33 #include "services/ui/ws/display_manager.h" |
34 #include "services/ui/ws/gpu_host.h" | 34 #include "services/ui/ws/gpu_host.h" |
35 #include "services/ui/ws/user_activity_monitor.h" | 35 #include "services/ui/ws/user_activity_monitor.h" |
36 #include "services/ui/ws/user_display_manager.h" | 36 #include "services/ui/ws/user_display_manager.h" |
37 #include "services/ui/ws/window_server.h" | 37 #include "services/ui/ws/window_server.h" |
38 #include "services/ui/ws/window_server_test_impl.h" | 38 #include "services/ui/ws/window_server_test_impl.h" |
39 #include "services/ui/ws/window_tree.h" | 39 #include "services/ui/ws/window_tree.h" |
40 #include "services/ui/ws/window_tree_binding.h" | 40 #include "services/ui/ws/window_tree_binding.h" |
41 #include "services/ui/ws/window_tree_factory.h" | 41 #include "services/ui/ws/window_tree_factory.h" |
42 #include "services/ui/ws/window_tree_host_factory.h" | 42 #include "services/ui/ws/window_tree_host_factory.h" |
| 43 #include "ui/base/platform_window_defaults.h" |
43 #include "ui/base/resource/resource_bundle.h" | 44 #include "ui/base/resource/resource_bundle.h" |
44 #include "ui/base/ui_base_paths.h" | 45 #include "ui/base/ui_base_paths.h" |
45 #include "ui/events/event_switches.h" | 46 #include "ui/events/event_switches.h" |
46 #include "ui/events/platform/platform_event_source.h" | 47 #include "ui/events/platform/platform_event_source.h" |
47 #include "ui/gfx/geometry/rect.h" | 48 #include "ui/gfx/geometry/rect.h" |
48 #include "ui/gl/gl_surface.h" | 49 #include "ui/gl/gl_surface.h" |
49 | 50 |
50 #if defined(USE_X11) | 51 #if defined(USE_X11) |
51 #include <X11/Xlib.h> | 52 #include <X11/Xlib.h> |
52 #include "ui/base/x/x11_util.h" // nogncheck | 53 #include "ui/base/x/x11_util.h" // nogncheck |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 142 |
142 void Service::OnStart() { | 143 void Service::OnStart() { |
143 base::PlatformThread::SetName("mus"); | 144 base::PlatformThread::SetName("mus"); |
144 tracing_.Initialize(context()->connector(), context()->identity().name()); | 145 tracing_.Initialize(context()->connector(), context()->identity().name()); |
145 TRACE_EVENT0("mus", "Service::Initialize started"); | 146 TRACE_EVENT0("mus", "Service::Initialize started"); |
146 | 147 |
147 test_config_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 148 test_config_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
148 switches::kUseTestConfig); | 149 switches::kUseTestConfig); |
149 #if defined(USE_X11) | 150 #if defined(USE_X11) |
150 XInitThreads(); | 151 XInitThreads(); |
151 if (test_config_) | |
152 ui::test::SetUseOverrideRedirectWindowByDefault(true); | |
153 ui::SetDefaultX11ErrorHandlers(); | 152 ui::SetDefaultX11ErrorHandlers(); |
154 #endif | 153 #endif |
155 | 154 |
| 155 if (test_config_) |
| 156 ui::test::EnableTestConfigForPlatformWindows(); |
| 157 |
156 InitializeResources(context()->connector()); | 158 InitializeResources(context()->connector()); |
157 | 159 |
158 #if defined(USE_OZONE) | 160 #if defined(USE_OZONE) |
159 // The ozone platform can provide its own event source. So initialize the | 161 // The ozone platform can provide its own event source. So initialize the |
160 // platform before creating the default event source. | 162 // platform before creating the default event source. |
161 // Because GL libraries need to be initialized before entering the sandbox, | 163 // Because GL libraries need to be initialized before entering the sandbox, |
162 // in MUS, |InitializeForUI| will load the GL libraries. | 164 // in MUS, |InitializeForUI| will load the GL libraries. |
163 ui::OzonePlatform::InitParams params; | 165 ui::OzonePlatform::InitParams params; |
164 params.connector = context()->connector(); | 166 params.connector = context()->connector(); |
165 params.single_process = false; | 167 params.single_process = false; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 mojom::WindowServerTestRequest request) { | 365 mojom::WindowServerTestRequest request) { |
364 if (!test_config_) | 366 if (!test_config_) |
365 return; | 367 return; |
366 mojo::MakeStrongBinding( | 368 mojo::MakeStrongBinding( |
367 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), | 369 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), |
368 std::move(request)); | 370 std::move(request)); |
369 } | 371 } |
370 | 372 |
371 | 373 |
372 } // namespace ui | 374 } // namespace ui |
OLD | NEW |