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" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "mojo/public/c/system/main.h" | 15 #include "mojo/public/c/system/main.h" |
16 #include "services/catalog/public/cpp/resource_loader.h" | 16 #include "services/catalog/public/cpp/resource_loader.h" |
17 #include "services/shell/public/cpp/connection.h" | 17 #include "services/shell/public/cpp/connection.h" |
18 #include "services/shell/public/cpp/connector.h" | 18 #include "services/shell/public/cpp/connector.h" |
19 #include "services/tracing/public/cpp/tracing_impl.h" | 19 #include "services/tracing/public/cpp/tracing_impl.h" |
20 #include "services/ui/clipboard/clipboard_impl.h" | 20 #include "services/ui/clipboard/clipboard_impl.h" |
21 #include "services/ui/common/switches.h" | 21 #include "services/ui/common/switches.h" |
| 22 #include "services/ui/display/platform_screen.h" |
22 #include "services/ui/gles2/gpu_impl.h" | 23 #include "services/ui/gles2/gpu_impl.h" |
23 #include "services/ui/gpu/gpu_service_impl.h" | 24 #include "services/ui/gpu/gpu_service_impl.h" |
24 #include "services/ui/gpu/gpu_service_mus.h" | 25 #include "services/ui/gpu/gpu_service_mus.h" |
25 #include "services/ui/ws/display.h" | 26 #include "services/ui/ws/display.h" |
26 #include "services/ui/ws/display_binding.h" | 27 #include "services/ui/ws/display_binding.h" |
27 #include "services/ui/ws/display_manager.h" | 28 #include "services/ui/ws/display_manager.h" |
28 #include "services/ui/ws/platform_screen.h" | |
29 #include "services/ui/ws/user_activity_monitor.h" | 29 #include "services/ui/ws/user_activity_monitor.h" |
30 #include "services/ui/ws/user_display_manager.h" | 30 #include "services/ui/ws/user_display_manager.h" |
31 #include "services/ui/ws/window_server.h" | 31 #include "services/ui/ws/window_server.h" |
32 #include "services/ui/ws/window_server_test_impl.h" | 32 #include "services/ui/ws/window_server_test_impl.h" |
33 #include "services/ui/ws/window_tree.h" | 33 #include "services/ui/ws/window_tree.h" |
34 #include "services/ui/ws/window_tree_binding.h" | 34 #include "services/ui/ws/window_tree_binding.h" |
35 #include "services/ui/ws/window_tree_factory.h" | 35 #include "services/ui/ws/window_tree_factory.h" |
36 #include "services/ui/ws/window_tree_host_factory.h" | 36 #include "services/ui/ws/window_tree_host_factory.h" |
37 #include "ui/base/resource/resource_bundle.h" | 37 #include "ui/base/resource/resource_bundle.h" |
38 #include "ui/base/ui_base_paths.h" | 38 #include "ui/base/ui_base_paths.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 Service::Service() | 81 Service::Service() |
82 : test_config_(false), | 82 : test_config_(false), |
83 // TODO(penghuang): Kludge: Use mojo command buffer when running on | 83 // TODO(penghuang): Kludge: Use mojo command buffer when running on |
84 // Windows since chrome command buffer breaks unit tests | 84 // Windows since chrome command buffer breaks unit tests |
85 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
86 use_chrome_gpu_command_buffer_(false), | 86 use_chrome_gpu_command_buffer_(false), |
87 #else | 87 #else |
88 use_chrome_gpu_command_buffer_(true), | 88 use_chrome_gpu_command_buffer_(true), |
89 #endif | 89 #endif |
90 platform_screen_(ws::PlatformScreen::Create()), | 90 platform_screen_(display::PlatformScreen::Create()), |
91 weak_ptr_factory_(this) { | 91 weak_ptr_factory_(this) { |
92 } | 92 } |
93 | 93 |
94 Service::~Service() { | 94 Service::~Service() { |
95 // Destroy |window_server_| first, since it depends on |event_source_|. | 95 // Destroy |window_server_| first, since it depends on |event_source_|. |
96 // WindowServer (or more correctly its Displays) may have state that needs to | 96 // WindowServer (or more correctly its Displays) may have state that needs to |
97 // be destroyed before GpuState as well. | 97 // be destroyed before GpuState as well. |
98 window_server_.reset(); | 98 window_server_.reset(); |
99 | 99 |
100 if (platform_display_init_params_.gpu_state) | 100 if (platform_display_init_params_.gpu_state) |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // Display manages its own lifetime. | 380 // Display manages its own lifetime. |
381 ws::Display* host_impl = | 381 ws::Display* host_impl = |
382 new ws::Display(window_server_.get(), platform_display_init_params_); | 382 new ws::Display(window_server_.get(), platform_display_init_params_); |
383 host_impl->Init(nullptr); | 383 host_impl->Init(nullptr); |
384 | 384 |
385 if (touch_controller_) | 385 if (touch_controller_) |
386 touch_controller_->UpdateTouchTransforms(); | 386 touch_controller_->UpdateTouchTransforms(); |
387 } | 387 } |
388 | 388 |
389 } // namespace ui | 389 } // namespace ui |
OLD | NEW |