OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/app/mash/embedded_services.h" | 5 #include "chrome/app/mash/embedded_services.h" |
6 | 6 |
7 #include "mash/catalog_viewer/catalog_viewer.h" | 7 #include "mash/catalog_viewer/catalog_viewer.h" |
8 #include "mash/catalog_viewer/public/interfaces/constants.mojom.h" | 8 #include "mash/catalog_viewer/public/interfaces/constants.mojom.h" |
9 #include "mash/common/config.h" | 9 #include "mash/common/config.h" |
10 #include "mash/quick_launch/public/interfaces/constants.mojom.h" | 10 #include "mash/quick_launch/public/interfaces/constants.mojom.h" |
11 #include "mash/quick_launch/quick_launch.h" | 11 #include "mash/quick_launch/quick_launch.h" |
12 #include "mash/session/public/interfaces/constants.mojom.h" | 12 #include "mash/session/public/interfaces/constants.mojom.h" |
13 #include "mash/session/session.h" | 13 #include "mash/session/session.h" |
14 #include "mash/task_viewer/public/interfaces/constants.mojom.h" | 14 #include "mash/task_viewer/public/interfaces/constants.mojom.h" |
15 #include "mash/task_viewer/task_viewer.h" | 15 #include "mash/task_viewer/task_viewer.h" |
| 16 #include "services/tracing/public/interfaces/constants.mojom.h" |
| 17 #include "services/tracing/service.h" |
16 #include "services/ui/ime/test_ime_driver/test_ime_application.h" | 18 #include "services/ui/ime/test_ime_driver/test_ime_application.h" |
17 #include "services/ui/public/interfaces/constants.mojom.h" | 19 #include "services/ui/public/interfaces/constants.mojom.h" |
18 #include "services/ui/service.h" | 20 #include "services/ui/service.h" |
19 | 21 |
20 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
21 #include "ash/autoclick/mus/autoclick_application.h" // nogncheck | 23 #include "ash/autoclick/mus/autoclick_application.h" // nogncheck |
22 #include "ash/mus/window_manager_application.h" // nogncheck | 24 #include "ash/mus/window_manager_application.h" // nogncheck |
23 #include "ash/public/interfaces/constants.mojom.h" // nogncheck | 25 #include "ash/public/interfaces/constants.mojom.h" // nogncheck |
24 #include "ash/touch_hud/mus/touch_hud_application.h" // nogncheck | 26 #include "ash/touch_hud/mus/touch_hud_application.h" // nogncheck |
25 #endif // defined(OS_CHROMEOS) | 27 #endif // defined(OS_CHROMEOS) |
26 | 28 |
27 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 29 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
28 #include "components/font_service/font_service_app.h" | 30 #include "components/font_service/font_service_app.h" |
29 #endif // defined(OS_LINUX) && !defined(OS_ANDROID) | 31 #endif // defined(OS_LINUX) && !defined(OS_ANDROID) |
30 | 32 |
31 std::unique_ptr<service_manager::Service> CreateEmbeddedMashService( | 33 std::unique_ptr<service_manager::Service> CreateEmbeddedMashService( |
32 const std::string& service_name) { | 34 const std::string& service_name) { |
33 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
34 if (service_name == ash::mojom::kServiceName) { | 36 if (service_name == ash::mojom::kServiceName) { |
35 const bool show_primary_host_on_connect = true; | 37 const bool show_primary_host_on_connect = true; |
36 return base::WrapUnique( | 38 return base::WrapUnique( |
37 new ash::mus::WindowManagerApplication(show_primary_host_on_connect)); | 39 new ash::mus::WindowManagerApplication(show_primary_host_on_connect)); |
38 } | 40 } |
39 if (service_name == "accessibility_autoclick") | 41 if (service_name == "accessibility_autoclick") |
40 return base::MakeUnique<ash::autoclick::AutoclickApplication>(); | 42 return base::MakeUnique<ash::autoclick::AutoclickApplication>(); |
41 if (service_name == "touch_hud") | 43 if (service_name == "touch_hud") |
42 return base::MakeUnique<ash::touch_hud::TouchHudApplication>(); | 44 return base::MakeUnique<ash::touch_hud::TouchHudApplication>(); |
| 45 if (service_name == tracing::mojom::kServiceName) |
| 46 return base::MakeUnique<tracing::Service>(); |
43 #endif // defined(OS_CHROMEOS) | 47 #endif // defined(OS_CHROMEOS) |
44 if (service_name == mash::catalog_viewer::mojom::kServiceName) | 48 if (service_name == mash::catalog_viewer::mojom::kServiceName) |
45 return base::MakeUnique<mash::catalog_viewer::CatalogViewer>(); | 49 return base::MakeUnique<mash::catalog_viewer::CatalogViewer>(); |
46 if (service_name == mash::session::mojom::kServiceName) | 50 if (service_name == mash::session::mojom::kServiceName) |
47 return base::MakeUnique<mash::session::Session>(); | 51 return base::MakeUnique<mash::session::Session>(); |
48 if (service_name == ui::mojom::kServiceName) | 52 if (service_name == ui::mojom::kServiceName) |
49 return base::MakeUnique<ui::Service>(); | 53 return base::MakeUnique<ui::Service>(); |
50 if (service_name == mash::quick_launch::mojom::kServiceName) | 54 if (service_name == mash::quick_launch::mojom::kServiceName) |
51 return base::MakeUnique<mash::quick_launch::QuickLaunch>(); | 55 return base::MakeUnique<mash::quick_launch::QuickLaunch>(); |
52 if (service_name == mash::task_viewer::mojom::kServiceName) | 56 if (service_name == mash::task_viewer::mojom::kServiceName) |
53 return base::MakeUnique<mash::task_viewer::TaskViewer>(); | 57 return base::MakeUnique<mash::task_viewer::TaskViewer>(); |
54 if (service_name == "test_ime_driver") | 58 if (service_name == "test_ime_driver") |
55 return base::MakeUnique<ui::test::TestIMEApplication>(); | 59 return base::MakeUnique<ui::test::TestIMEApplication>(); |
56 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 60 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
57 if (service_name == "font_service") | 61 if (service_name == "font_service") |
58 return base::MakeUnique<font_service::FontServiceApp>(); | 62 return base::MakeUnique<font_service::FontServiceApp>(); |
59 #endif // defined(OS_LINUX) && !defined(OS_ANDROID) | 63 #endif // defined(OS_LINUX) && !defined(OS_ANDROID) |
60 | 64 |
61 return nullptr; | 65 return nullptr; |
62 } | 66 } |
OLD | NEW |