| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mash/package/mash_packaged_service.h" | 5 #include "mash/package/mash_packaged_service.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/process/process.h" | 11 #include "base/process/process.h" |
| 12 #include "mash/catalog_viewer/catalog_viewer.h" | 12 #include "mash/catalog_viewer/catalog_viewer.h" |
| 13 #include "mash/catalog_viewer/public/interfaces/constants.mojom.h" | 13 #include "mash/catalog_viewer/public/interfaces/constants.mojom.h" |
| 14 #include "mash/quick_launch/public/interfaces/constants.mojom.h" | 14 #include "mash/quick_launch/public/interfaces/constants.mojom.h" |
| 15 #include "mash/quick_launch/quick_launch.h" | 15 #include "mash/quick_launch/quick_launch.h" |
| 16 #include "mash/session/public/interfaces/constants.mojom.h" | 16 #include "mash/session/public/interfaces/constants.mojom.h" |
| 17 #include "mash/session/session.h" | 17 #include "mash/session/session.h" |
| 18 #include "mash/task_viewer/public/interfaces/constants.mojom.h" | 18 #include "mash/task_viewer/public/interfaces/constants.mojom.h" |
| 19 #include "mash/task_viewer/task_viewer.h" | 19 #include "mash/task_viewer/task_viewer.h" |
| 20 #include "services/service_manager/public/cpp/interface_registry.h" | |
| 21 #include "services/service_manager/public/cpp/service_context.h" | 20 #include "services/service_manager/public/cpp/service_context.h" |
| 22 #include "services/ui/ime/test_ime_driver/test_ime_application.h" | 21 #include "services/ui/ime/test_ime_driver/test_ime_application.h" |
| 23 #include "services/ui/public/interfaces/constants.mojom.h" | 22 #include "services/ui/public/interfaces/constants.mojom.h" |
| 24 #include "services/ui/service.h" | 23 #include "services/ui/service.h" |
| 25 | 24 |
| 26 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
| 27 #include "ash/autoclick/mus/autoclick_application.h" // nogncheck | 26 #include "ash/autoclick/mus/autoclick_application.h" // nogncheck |
| 28 #include "ash/mus/window_manager_application.h" // nogncheck | 27 #include "ash/mus/window_manager_application.h" // nogncheck |
| 29 #include "ash/public/interfaces/constants.mojom.h" // nogncheck | 28 #include "ash/public/interfaces/constants.mojom.h" // nogncheck |
| 30 #include "ash/touch_hud/mus/touch_hud_application.h" // nogncheck | 29 #include "ash/touch_hud/mus/touch_hud_application.h" // nogncheck |
| 31 #endif | 30 #endif |
| 32 | 31 |
| 33 #if defined(OS_LINUX) | 32 #if defined(OS_LINUX) |
| 34 #include "components/font_service/font_service_app.h" | 33 #include "components/font_service/font_service_app.h" |
| 35 #endif | 34 #endif |
| 36 | 35 |
| 37 namespace mash { | 36 namespace mash { |
| 38 | 37 |
| 39 MashPackagedService::MashPackagedService() {} | 38 MashPackagedService::MashPackagedService() { |
| 39 registry_.AddInterface<ServiceFactory>(this); |
| 40 } |
| 40 | 41 |
| 41 MashPackagedService::~MashPackagedService() {} | 42 MashPackagedService::~MashPackagedService() {} |
| 42 | 43 |
| 43 bool MashPackagedService::OnConnect( | 44 void MashPackagedService::OnBindInterface( |
| 44 const service_manager::ServiceInfo& remote_info, | 45 const service_manager::ServiceInfo& source_info, |
| 45 service_manager::InterfaceRegistry* registry) { | 46 const std::string& interface_name, |
| 46 registry->AddInterface<ServiceFactory>(this); | 47 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 47 return true; | 48 registry_.BindInterface(source_info.identity, interface_name, |
| 49 std::move(interface_pipe)); |
| 48 } | 50 } |
| 49 | 51 |
| 50 void MashPackagedService::Create( | 52 void MashPackagedService::Create( |
| 51 const service_manager::Identity& remote_identity, | 53 const service_manager::Identity& remote_identity, |
| 52 mojo::InterfaceRequest<ServiceFactory> request) { | 54 mojo::InterfaceRequest<ServiceFactory> request) { |
| 53 service_factory_bindings_.AddBinding(this, std::move(request)); | 55 service_factory_bindings_.AddBinding(this, std::move(request)); |
| 54 } | 56 } |
| 55 | 57 |
| 56 void MashPackagedService::CreateService( | 58 void MashPackagedService::CreateService( |
| 57 service_manager::mojom::ServiceRequest request, | 59 service_manager::mojom::ServiceRequest request, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 if (name == "test_ime_driver") | 107 if (name == "test_ime_driver") |
| 106 return base::WrapUnique(new ui::test::TestIMEApplication); | 108 return base::WrapUnique(new ui::test::TestIMEApplication); |
| 107 #if defined(OS_LINUX) | 109 #if defined(OS_LINUX) |
| 108 if (name == "font_service") | 110 if (name == "font_service") |
| 109 return base::WrapUnique(new font_service::FontServiceApp); | 111 return base::WrapUnique(new font_service::FontServiceApp); |
| 110 #endif | 112 #endif |
| 111 return nullptr; | 113 return nullptr; |
| 112 } | 114 } |
| 113 | 115 |
| 114 } // namespace mash | 116 } // namespace mash |
| OLD | NEW |