Simplify out-of-process service registration

This eliminates the need to register out-of-process services at the
Content layer, separate from their manifests. Display names for service
processes are taken directly from the manifest now, including support
for string resource IDs resolved to localized strings by the Service
Manager at runtime.

Bug: 915806, 895615
Change-Id: I585b03ceb5489ea1a11f95a1c77d9b36048068c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615882
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Reviewed-by: Colin Blundell <[email protected]>
Reviewed-by: Sami Kyöstilä <[email protected]>
Reviewed-by: Steven Bennetts <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Commit-Queue: Ken Rockot <[email protected]>
Cr-Commit-Position: refs/heads/master@{#664438}
diff --git a/components/components_strings.grd b/components/components_strings.grd
index f35232385..06d62e1 100644
--- a/components/components_strings.grd
+++ b/components/components_strings.grd
@@ -382,6 +382,13 @@
       <message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY">
         Privacy
       </message>
+
+      <message name="IDS_PATCH_SERVICE_DISPLAY_NAME" desc="The display name (in the system task manager, etc) of the service process used for patching file operations.">
+        Patch Service
+      </message>
+      <message name="IDS_UNZIP_SERVICE_DISPLAY_NAME" desc="The display name (in the system task manager, etc) of the service process used for unzipping files.">
+        Unzip Service
+      </message>
     </messages>
   </release>
 </grit>
diff --git a/components/printing_component_strings.grdp b/components/printing_component_strings.grdp
index f157cba..f3cbf56 100644
--- a/components/printing_component_strings.grdp
+++ b/components/printing_component_strings.grdp
@@ -7,4 +7,8 @@
       </message>
     </if>
   </if>
+
+  <message name="IDS_PDF_COMPOSITOR_SERVICE_DISPLAY_NAME" desc="The display name (in the system task manager, etc) of the service process used for PDF compositing.">
+    PDF Compositor Service
+  </message>
 </grit-part>
diff --git a/components/services/DEPS b/components/services/DEPS
index 7f957bc..cb3f445 100644
--- a/components/services/DEPS
+++ b/components/services/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
   "+mojo/public",
+  "+components/strings",
   "+services/service_manager/public",
 ]
diff --git a/components/services/patch/public/cpp/BUILD.gn b/components/services/patch/public/cpp/BUILD.gn
index 8f9c197..9c4cff4 100644
--- a/components/services/patch/public/cpp/BUILD.gn
+++ b/components/services/patch/public/cpp/BUILD.gn
@@ -25,6 +25,7 @@
   deps = [
     "//base",
     "//components/services/patch/public/interfaces",
+    "//components/strings",
     "//services/service_manager/public/cpp",
   ]
 }
diff --git a/components/services/patch/public/cpp/manifest.cc b/components/services/patch/public/cpp/manifest.cc
index 087aa25..5bd8dc8 100644
--- a/components/services/patch/public/cpp/manifest.cc
+++ b/components/services/patch/public/cpp/manifest.cc
@@ -7,6 +7,7 @@
 #include "base/no_destructor.h"
 #include "components/services/patch/public/interfaces/constants.mojom.h"
 #include "components/services/patch/public/interfaces/file_patcher.mojom.h"
+#include "components/strings/grit/components_strings.h"
 #include "services/service_manager/public/cpp/manifest_builder.h"
 
 namespace patch {
@@ -15,7 +16,7 @@
   static base::NoDestructor<service_manager::Manifest> manifest{
       service_manager::ManifestBuilder()
           .WithServiceName(mojom::kServiceName)
-          .WithDisplayName("Patch Service")
+          .WithDisplayName(IDS_PATCH_SERVICE_DISPLAY_NAME)
           .WithOptions(service_manager::ManifestOptionsBuilder()
                            .WithSandboxType("utility")
                            .WithInstanceSharingPolicy(
diff --git a/components/services/pdf_compositor/public/cpp/BUILD.gn b/components/services/pdf_compositor/public/cpp/BUILD.gn
index 426a934..3bdfd61d3 100644
--- a/components/services/pdf_compositor/public/cpp/BUILD.gn
+++ b/components/services/pdf_compositor/public/cpp/BUILD.gn
@@ -31,6 +31,7 @@
   deps = [
     "//base",
     "//components/services/pdf_compositor/public/interfaces",
+    "//components/strings",
     "//services/service_manager/public/cpp",
   ]
 }
diff --git a/components/services/pdf_compositor/public/cpp/manifest.cc b/components/services/pdf_compositor/public/cpp/manifest.cc
index 400254cb..cf049d1 100644
--- a/components/services/pdf_compositor/public/cpp/manifest.cc
+++ b/components/services/pdf_compositor/public/cpp/manifest.cc
@@ -6,6 +6,7 @@
 
 #include "base/no_destructor.h"
 #include "components/services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h"
+#include "components/strings/grit/components_strings.h"
 #include "services/service_manager/public/cpp/manifest_builder.h"
 
 namespace printing {
@@ -14,7 +15,7 @@
   static base::NoDestructor<service_manager::Manifest> manifest{
       service_manager::ManifestBuilder()
           .WithServiceName(mojom::kServiceName)
-          .WithDisplayName("PDF Compositor Service")
+          .WithDisplayName(IDS_PDF_COMPOSITOR_SERVICE_DISPLAY_NAME)
           .WithOptions(service_manager::ManifestOptionsBuilder()
                            .WithSandboxType("pdf_compositor")
                            .WithInstanceSharingPolicy(
diff --git a/components/services/unzip/public/cpp/BUILD.gn b/components/services/unzip/public/cpp/BUILD.gn
index 8deacf71..83715f08 100644
--- a/components/services/unzip/public/cpp/BUILD.gn
+++ b/components/services/unzip/public/cpp/BUILD.gn
@@ -41,6 +41,7 @@
   deps = [
     "//base",
     "//components/services/unzip/public/interfaces",
+    "//components/strings",
     "//services/service_manager/public/cpp",
   ]
 }
diff --git a/components/services/unzip/public/cpp/manifest.cc b/components/services/unzip/public/cpp/manifest.cc
index a6ec2adb..fb98141 100644
--- a/components/services/unzip/public/cpp/manifest.cc
+++ b/components/services/unzip/public/cpp/manifest.cc
@@ -7,6 +7,7 @@
 #include "base/no_destructor.h"
 #include "components/services/unzip/public/interfaces/constants.mojom.h"
 #include "components/services/unzip/public/interfaces/unzipper.mojom.h"
+#include "components/strings/grit/components_strings.h"
 #include "services/service_manager/public/cpp/manifest_builder.h"
 
 namespace unzip {
@@ -15,7 +16,7 @@
   static base::NoDestructor<service_manager::Manifest> manifest{
       service_manager::ManifestBuilder()
           .WithServiceName(mojom::kServiceName)
-          .WithDisplayName("Unzip Service")
+          .WithDisplayName(IDS_UNZIP_SERVICE_DISPLAY_NAME)
           .WithOptions(service_manager::ManifestOptionsBuilder()
                            .WithSandboxType("utility")
                            .WithInstanceSharingPolicy(