Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors |
Ken Rockot | 2925f500 | 2019-08-06 01:16:16 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/file_util_service.h" |
| 6 | |
| 7 | #include "chrome/grit/generated_resources.h" |
Alex Gough | 5a90be0 | 2021-08-13 06:00:35 | [diff] [blame] | 8 | #include "chrome/services/file_util/public/mojom/file_util_service.mojom.h" |
Ken Rockot | 2925f500 | 2019-08-06 01:16:16 | [diff] [blame] | 9 | #include "components/strings/grit/components_strings.h" |
| 10 | #include "content/public/browser/service_process_host.h" |
Alex Gough | 71f4a4b | 2023-05-21 22:06:47 | [diff] [blame] | 11 | |
Alex Gough | 71f4a4b | 2023-05-21 22:06:47 | [diff] [blame] | 12 | // Class allows us to friend the passkeys we need to launch the service. |
| 13 | class FileUtilServiceLauncher { |
| 14 | public: |
| 15 | static mojo::PendingRemote<chrome::mojom::FileUtilService> |
| 16 | LaunchFileUtilService() { |
| 17 | mojo::PendingRemote<chrome::mojom::FileUtilService> remote; |
| 18 | content::ServiceProcessHost::Launch<chrome::mojom::FileUtilService>( |
| 19 | remote.InitWithNewPipeAndPassReceiver(), |
| 20 | content::ServiceProcessHost::Options() |
Alex Gough | 71f4a4b | 2023-05-21 22:06:47 | [diff] [blame] | 21 | .WithDisplayName(IDS_UTILITY_PROCESS_FILE_UTILITY_NAME) |
| 22 | .Pass()); |
| 23 | return remote; |
| 24 | } |
| 25 | }; |
Ken Rockot | 2925f500 | 2019-08-06 01:16:16 | [diff] [blame] | 26 | |
| 27 | mojo::PendingRemote<chrome::mojom::FileUtilService> LaunchFileUtilService() { |
Hyungwook Lee | f4ada79 | 2024-09-13 08:13:20 | [diff] [blame] | 28 | return FileUtilServiceLauncher::LaunchFileUtilService(); |
Ken Rockot | 2925f500 | 2019-08-06 01:16:16 | [diff] [blame] | 29 | } |