Shape Detection: Move mojom interface to //services

This CL moves Shape Detection mojo interfaces to //services, which exposes them
to public instead of just Blink. No new code added.

Blocking: https://codereview.chromium.org/2460723003/

[email protected] (mechanical move)
BUG=646083, 659139
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2620083002
Cr-Commit-Position: refs/heads/master@{#442991}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index e7b2d0b..f1bae98 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1543,6 +1543,7 @@
     "//services/image_decoder/public/cpp",
     "//services/preferences/public/interfaces/",
     "//services/service_manager/public/cpp",
+    "//services/shape_detection/public/interfaces",
     "//skia",
     "//sql",
     "//storage/browser",
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS
index 14e6183..b993f0ef9 100644
--- a/chrome/browser/DEPS
+++ b/chrome/browser/DEPS
@@ -38,18 +38,18 @@
   "+media/cdm/cdm_paths.h",
   "+media/midi",  # For midi switches
   "+media/mojo",  # For mojo media services.
-  "+services/image_decoder/public/cpp",
-  "+services/service_manager/public/cpp",
-  "+services/ui/public",
   "+ppapi/c",  # For various types.
   "+ppapi/host",
   "+ppapi/proxy",
   "+ppapi/shared_impl",
   "+rlz",
   "+sandbox/win/src",  # The path doesn't say it, but this is the Windows sandbox.
+  "+services/image_decoder/public/cpp",
   "+services/image_decoder/public/interfaces",
   "+services/preferences/public/interfaces",
   "+services/service_manager",
+  "+services/shape_detection/public/interfaces",
+  "+services/ui/public",
   "+skia/ext",
   "+syzygy/kasko",
   "+third_party/boringssl/src/include",
@@ -111,8 +111,6 @@
   "+third_party/WebKit/public/platform/modules/remoteplayback/WebRemotePlaybackAvailability.h",
   "+third_party/WebKit/public/platform/modules/screen_orientation/WebScreenOrientationLockType.h",
   "+third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h",
-  "+third_party/WebKit/public/platform/modules/shapedetection/barcodedetection.mojom.h",
-  "+third_party/WebKit/public/platform/modules/shapedetection/textdetection.mojom.h",
   "+third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h",
   "+third_party/WebKit/public/platform/site_engagement.mojom.h",
   "+third_party/WebKit/public/public_features.h",
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index c62d864..ad1ebe5 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -202,9 +202,9 @@
 #include "services/service_manager/public/cpp/interface_provider.h"
 #include "services/service_manager/public/cpp/interface_registry.h"
 #include "services/service_manager/public/cpp/service.h"
+#include "services/shape_detection/public/interfaces/barcodedetection.mojom.h"
+#include "services/shape_detection/public/interfaces/textdetection.mojom.h"
 #include "storage/browser/fileapi/external_mount_points.h"
-#include "third_party/WebKit/public/platform/modules/shapedetection/barcodedetection.mojom.h"
-#include "third_party/WebKit/public/platform/modules/shapedetection/textdetection.mojom.h"
 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
@@ -3003,7 +3003,11 @@
     if (AreExperimentalWebPlatformFeaturesEnabled()) {
       registry->AddInterface(
           web_contents->GetJavaInterfaces()
-              ->CreateInterfaceFactory<blink::mojom::BarcodeDetection>());
+              ->CreateInterfaceFactory<
+                  shape_detection::mojom::BarcodeDetection>());
+      registry->AddInterface(web_contents->GetJavaInterfaces()
+                                 ->CreateInterfaceFactory<
+                                     shape_detection::mojom::TextDetection>());
     }
   }
 #elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
diff --git a/chrome/browser/chrome_content_browser_manifest_overlay.json b/chrome/browser/chrome_content_browser_manifest_overlay.json
index 427fa05..30087f5 100644
--- a/chrome/browser/chrome_content_browser_manifest_overlay.json
+++ b/chrome/browser/chrome_content_browser_manifest_overlay.json
@@ -57,9 +57,7 @@
         "renderer": [
           "autofill::mojom::AutofillDriver",
           "autofill::mojom::PasswordManagerDriver",
-          "blink::mojom::BarcodeDetection",
           "blink::mojom::ShareService",
-          "blink::mojom::TextDetection",
           "bluetooth::mojom::AdapterFactory",
           "device::usb::ChooserService",
           "device::usb::DeviceManager",
@@ -71,6 +69,8 @@
           "media_router::mojom::MediaRouter",
           "mojom::OmniboxPageHandler",
           "password_manager::mojom::CredentialManager",
+          "shape_detection::mojom::BarcodeDetection",
+          "shape_detection::mojom::TextDetection",
           "translate::mojom::ContentTranslateDriver",
 
           // TODO(beng): These should be moved to a separate capability.