Move MediaDevices C++ and Mojo interfaces to blink/public/common and blink/public/mojom

The Mojo interface was defined in public/platform/ and the C++ interface was defined in
content/common.

This is part of onion souping the mediastream module.

Bug: 704136
Change-Id: I06cb202e791e445779b533ecc4896d086638300e
Reviewed-on: https://chromium-review.googlesource.com/c/1405314
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623218}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 02b749a..941b264 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -226,7 +226,6 @@
     "//ipc",
     "//media/mojo/interfaces:remoting",
     "//third_party/blink/public:embedded_frame_sink_mojo_bindings",
-    "//third_party/blink/public:media_devices_mojo_bindings",
     "//third_party/leveldatabase",
   ]
 
diff --git a/content/browser/media/media_devices_permission_checker.cc b/content/browser/media/media_devices_permission_checker.cc
index 2e1b182..eb4af5d 100644
--- a/content/browser/media/media_devices_permission_checker.cc
+++ b/content/browser/media/media_devices_permission_checker.cc
@@ -12,12 +12,12 @@
 #include "base/task/post_task.h"
 #include "content/browser/frame_host/render_frame_host_delegate.h"
 #include "content/browser/frame_host/render_frame_host_impl.h"
-#include "content/common/media/media_devices.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/common/content_switches.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
 #include "url/gurl.h"
 #include "url/origin.h"
 
@@ -52,18 +52,18 @@
   // Speakers.
   // TODO(guidou): use specific permission for audio output when it becomes
   // available. See http://crbug.com/556542.
-  result[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] =
-      requested_device_types[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] &&
+  result[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] =
+      requested_device_types[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] &&
       audio_permission;
 
   // Mic.
-  result[MEDIA_DEVICE_TYPE_AUDIO_INPUT] =
-      requested_device_types[MEDIA_DEVICE_TYPE_AUDIO_INPUT] &&
+  result[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] =
+      requested_device_types[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] &&
       audio_permission && mic_feature_policy;
 
   // Camera.
-  result[MEDIA_DEVICE_TYPE_VIDEO_INPUT] =
-      requested_device_types[MEDIA_DEVICE_TYPE_VIDEO_INPUT] &&
+  result[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] =
+      requested_device_types[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] &&
       delegate->CheckMediaAccessPermission(frame_host, origin,
                                            blink::MEDIA_DEVICE_VIDEO_CAPTURE) &&
       camera_feature_policy;
@@ -71,7 +71,7 @@
   return result;
 }
 
-bool CheckSinglePermissionOnUIThread(MediaDeviceType device_type,
+bool CheckSinglePermissionOnUIThread(blink::MediaDeviceType device_type,
                                      int render_process_id,
                                      int render_frame_id) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -96,7 +96,7 @@
     : use_override_(true), override_value_(override_value) {}
 
 bool MediaDevicesPermissionChecker::CheckPermissionOnUIThread(
-    MediaDeviceType device_type,
+    blink::MediaDeviceType device_type,
     int render_process_id,
     int render_frame_id) const {
   if (use_override_)
@@ -107,7 +107,7 @@
 }
 
 void MediaDevicesPermissionChecker::CheckPermission(
-    MediaDeviceType device_type,
+    blink::MediaDeviceType device_type,
     int render_process_id,
     int render_frame_id,
     base::OnceCallback<void(bool)> callback) const {
diff --git a/content/browser/media/media_devices_permission_checker.h b/content/browser/media/media_devices_permission_checker.h
index babbf97..8c6df4a 100644
--- a/content/browser/media/media_devices_permission_checker.h
+++ b/content/browser/media/media_devices_permission_checker.h
@@ -28,7 +28,7 @@
   // |render_process_id| and |render_frame_id| is allowed to access the media
   // device type |device_type|.
   // This method must be called on the UI thread.
-  bool CheckPermissionOnUIThread(MediaDeviceType device_type,
+  bool CheckPermissionOnUIThread(blink::MediaDeviceType device_type,
                                  int render_process_id,
                                  int render_frame_id) const;
 
@@ -37,7 +37,7 @@
   // device type |device_type|. The result is passed to |callback|.
   // This method can be called on any thread. |callback| is fired on the same
   // thread this method is called on.
-  void CheckPermission(MediaDeviceType device_type,
+  void CheckPermission(blink::MediaDeviceType device_type,
                        int render_process_id,
                        int render_frame_id,
                        base::OnceCallback<void(bool)> callback) const;
@@ -45,12 +45,11 @@
   // Checks if the origin associated to a render frame identified by
   // |render_process_id| and |render_frame_id| is allowed to access the media
   // device types marked with a value of true in |requested_device_types|. The
-  // result is passed to |callback|. The result is indexed by MediaDeviceType.
-  // Entries in the result with a value of true for requested device types
-  // indicate that the frame has permission to access devices of the
-  // corresponding types.
-  // This method can be called on any thread. |callback| is fired on the same
-  // thread this method is called on.
+  // result is passed to |callback|. The result is indexed by
+  // blink::MediaDeviceType. Entries in the result with a value of true for
+  // requested device types indicate that the frame has permission to access
+  // devices of the corresponding types. This method can be called on any
+  // thread. |callback| is fired on the same thread this method is called on.
   void CheckPermissions(
       MediaDevicesManager::BoolDeviceTypes requested_device_types,
       int render_process_id,
diff --git a/content/browser/media/media_devices_permission_checker_unittest.cc b/content/browser/media/media_devices_permission_checker_unittest.cc
index e21184e..46651a2 100644
--- a/content/browser/media/media_devices_permission_checker_unittest.cc
+++ b/content/browser/media/media_devices_permission_checker_unittest.cc
@@ -59,7 +59,7 @@
         ->SimulateFeaturePolicyHeader(feature, whitelist);
   }
 
-  bool CheckPermission(MediaDeviceType device_type) {
+  bool CheckPermission(blink::MediaDeviceType device_type) {
     base::RunLoop run_loop;
     quit_closure_ = run_loop.QuitClosure();
     checker_.CheckPermission(
@@ -101,18 +101,18 @@
 TEST_F(MediaDevicesPermissionCheckerTest, CheckPermissionWithFeaturePolicy) {
   // Mic and Camera should be enabled by default for a frame (if permission is
   // granted).
-  EXPECT_TRUE(CheckPermission(MEDIA_DEVICE_TYPE_AUDIO_INPUT));
-  EXPECT_TRUE(CheckPermission(MEDIA_DEVICE_TYPE_VIDEO_INPUT));
+  EXPECT_TRUE(CheckPermission(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT));
+  EXPECT_TRUE(CheckPermission(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT));
 
   RefreshPageAndSetHeaderPolicy(blink::mojom::FeaturePolicyFeature::kMicrophone,
                                 /*enabled=*/false);
-  EXPECT_FALSE(CheckPermission(MEDIA_DEVICE_TYPE_AUDIO_INPUT));
-  EXPECT_TRUE(CheckPermission(MEDIA_DEVICE_TYPE_VIDEO_INPUT));
+  EXPECT_FALSE(CheckPermission(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT));
+  EXPECT_TRUE(CheckPermission(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT));
 
   RefreshPageAndSetHeaderPolicy(blink::mojom::FeaturePolicyFeature::kCamera,
                                 /*enabled=*/false);
-  EXPECT_TRUE(CheckPermission(MEDIA_DEVICE_TYPE_AUDIO_INPUT));
-  EXPECT_FALSE(CheckPermission(MEDIA_DEVICE_TYPE_VIDEO_INPUT));
+  EXPECT_TRUE(CheckPermission(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT));
+  EXPECT_FALSE(CheckPermission(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT));
 }
 
 }  // namespace
diff --git a/content/browser/media/media_devices_util.cc b/content/browser/media/media_devices_util.cc
index 9ee36aa..7b5b355 100644
--- a/content/browser/media/media_devices_util.cc
+++ b/content/browser/media/media_devices_util.cc
@@ -28,9 +28,10 @@
 
 namespace {
 
-std::string GetDefaultMediaDeviceIDOnUIThread(MediaDeviceType device_type,
-                                              int render_process_id,
-                                              int render_frame_id) {
+std::string GetDefaultMediaDeviceIDOnUIThread(
+    blink::MediaDeviceType device_type,
+    int render_process_id,
+    int render_frame_id) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
   RenderFrameHostImpl* frame_host =
       RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
@@ -43,10 +44,10 @@
 
   blink::MediaStreamType media_stream_type;
   switch (device_type) {
-    case MEDIA_DEVICE_TYPE_AUDIO_INPUT:
+    case blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT:
       media_stream_type = blink::MEDIA_DEVICE_AUDIO_CAPTURE;
       break;
-    case MEDIA_DEVICE_TYPE_VIDEO_INPUT:
+    case blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT:
       media_stream_type = blink::MEDIA_DEVICE_VIDEO_CAPTURE;
       break;
     default:
@@ -59,7 +60,7 @@
 // This function is intended for testing purposes. It returns an empty string
 // if no default device is supplied via the command line.
 std::string GetDefaultMediaDeviceIDFromCommandLine(
-    MediaDeviceType device_type) {
+    blink::MediaDeviceType device_type) {
   DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
       switches::kUseFakeDeviceForMediaStream));
   const std::string option =
@@ -81,10 +82,10 @@
       return std::string();
     }
 
-    if (device_type == MEDIA_DEVICE_TYPE_AUDIO_INPUT &&
+    if (device_type == blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT &&
         param.front() == "audio-input-default-id") {
       return param.back();
-    } else if (device_type == MEDIA_DEVICE_TYPE_VIDEO_INPUT &&
+    } else if (device_type == blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT &&
                param.front() == "video-input-default-id") {
       return param.back();
     }
@@ -105,7 +106,7 @@
       origin(std::move(origin)) {}
 
 void GetDefaultMediaDeviceID(
-    MediaDeviceType device_type,
+    blink::MediaDeviceType device_type,
     int render_process_id,
     int render_frame_id,
     const base::Callback<void(const std::string&)>& callback) {
@@ -150,11 +151,11 @@
           std::move(origin)};
 }
 
-MediaDeviceInfo TranslateMediaDeviceInfo(
+blink::WebMediaDeviceInfo TranslateMediaDeviceInfo(
     bool has_permission,
     const MediaDeviceSaltAndOrigin& salt_and_origin,
-    const MediaDeviceInfo& device_info) {
-  return MediaDeviceInfo(
+    const blink::WebMediaDeviceInfo& device_info) {
+  return blink::WebMediaDeviceInfo(
       GetHMACForMediaDeviceID(salt_and_origin.device_id_salt,
                               salt_and_origin.origin, device_info.device_id),
       has_permission ? device_info.label : std::string(),
@@ -167,11 +168,11 @@
                      : media::MEDIA_VIDEO_FACING_NONE);
 }
 
-MediaDeviceInfoArray TranslateMediaDeviceInfoArray(
+blink::WebMediaDeviceInfoArray TranslateMediaDeviceInfoArray(
     bool has_permission,
     const MediaDeviceSaltAndOrigin& salt_and_origin,
-    const MediaDeviceInfoArray& device_infos) {
-  MediaDeviceInfoArray result;
+    const blink::WebMediaDeviceInfoArray& device_infos) {
+  blink::WebMediaDeviceInfoArray result;
   for (const auto& device_info : device_infos) {
     result.push_back(
         TranslateMediaDeviceInfo(has_permission, salt_and_origin, device_info));
diff --git a/content/browser/media/media_devices_util.h b/content/browser/media/media_devices_util.h
index d2a02ef..7665000 100644
--- a/content/browser/media/media_devices_util.h
+++ b/content/browser/media/media_devices_util.h
@@ -10,7 +10,7 @@
 
 #include "base/callback.h"
 #include "content/common/content_export.h"
-#include "content/common/media/media_devices.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
 #include "url/origin.h"
 
 namespace content {
@@ -18,7 +18,7 @@
 // Returns the ID of the user-default device ID via |callback|.
 // If no such device ID can be found, |callback| receives an empty string.
 CONTENT_EXPORT void GetDefaultMediaDeviceID(
-    MediaDeviceType device_type,
+    blink::MediaDeviceType device_type,
     int render_process_id,
     int render_frame_id,
     const base::Callback<void(const std::string&)>& callback);
@@ -47,17 +47,17 @@
 // The |device_id| field is hashed using |device_id_salt| and |security_origin|.
 // The |group_id| field is hashed using |group_id_salt| and |security_origin|.
 // The |label| field is removed if |has_permission| is false.
-MediaDeviceInfo TranslateMediaDeviceInfo(
+blink::WebMediaDeviceInfo TranslateMediaDeviceInfo(
     bool has_permission,
     const MediaDeviceSaltAndOrigin& salt_and_origin,
-    const MediaDeviceInfo& device_info);
+    const blink::WebMediaDeviceInfo& device_info);
 
 // Returns a translated version of |device_infos|, with each element translated
 // using TranslateMediaDeviceInfo().
-MediaDeviceInfoArray TranslateMediaDeviceInfoArray(
+blink::WebMediaDeviceInfoArray TranslateMediaDeviceInfoArray(
     bool has_permission,
     const MediaDeviceSaltAndOrigin& salt_and_origin,
-    const MediaDeviceInfoArray& device_infos);
+    const blink::WebMediaDeviceInfoArray& device_infos);
 
 // Type definition to make it easier to use mock alternatives to
 // GetMediaDeviceSaltAndOrigin.
diff --git a/content/browser/renderer_host/media/audio_output_authorization_handler.cc b/content/browser/renderer_host/media/audio_output_authorization_handler.cc
index 04e2fdb..21f3b537 100644
--- a/content/browser/renderer_host/media/audio_output_authorization_handler.cc
+++ b/content/browser/renderer_host/media/audio_output_authorization_handler.cc
@@ -54,11 +54,11 @@
     return;
   }
 
-  std::move(cb).Run(
-      std::move(salt_and_origin.device_id_salt),
-      std::move(salt_and_origin.origin),
-      MediaDevicesPermissionChecker().CheckPermissionOnUIThread(
-          MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, render_process_id, render_frame_id));
+  std::move(cb).Run(std::move(salt_and_origin.device_id_salt),
+                    std::move(salt_and_origin.origin),
+                    MediaDevicesPermissionChecker().CheckPermissionOnUIThread(
+                        blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT,
+                        render_process_id, render_frame_id));
 }
 
 }  // namespace
@@ -252,7 +252,7 @@
   }
 
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   media_stream_manager_->media_devices_manager()->EnumerateDevices(
       devices_to_enumerate,
       base::BindOnce(&AudioOutputAuthorizationHandler::TranslateDeviceID,
@@ -271,8 +271,8 @@
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(!media::AudioDeviceDescription::IsDefaultDevice(device_id));
 
-  for (const MediaDeviceInfo& device_info :
-       enumeration[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]) {
+  for (const blink::WebMediaDeviceInfo& device_info :
+       enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]) {
     if (DoesMediaDeviceIDMatchHMAC(salt, security_origin, device_id,
                                    device_info.device_id)) {
       GetDeviceParameters(std::move(trace_scope), std::move(cb),
diff --git a/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc b/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc
index 33e7daf..f75d5e1 100644
--- a/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc
+++ b/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc
@@ -166,18 +166,21 @@
   void GetRawNondefaultIdOnIOThread(std::string* out) {
     DCHECK_CURRENTLY_ON(BrowserThread::IO);
     MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-    devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+    devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
 
     media_stream_manager_->media_devices_manager()->EnumerateDevices(
         devices_to_enumerate,
         base::BindOnce(
             [](std::string* out, const MediaDeviceEnumeration& result) {
               // Index 0 is default, so use 1.
-              CHECK(result[MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]
-                        .size() > 1)
+              CHECK(
+                  result[blink::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]
+                      .size() > 1)
                   << "Expected to have a nondefault device.";
-              *out = result[MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT][1]
-                         .device_id;
+              *out =
+                  result[blink::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]
+                        [1]
+                            .device_id;
             },
             base::Unretained(out)));
   }
diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host.cc b/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
index 78395c3..181c255 100644
--- a/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
+++ b/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
@@ -16,7 +16,6 @@
 #include "content/browser/media/media_devices_permission_checker.h"
 #include "content/browser/renderer_host/media/media_stream_manager.h"
 #include "content/browser/renderer_host/media/video_capture_manager.h"
-#include "content/common/media/media_devices.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
@@ -27,6 +26,7 @@
 #include "media/base/video_facing.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
 #include "services/service_manager/public/cpp/interface_provider.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
 #include "third_party/blink/public/common/mediastream/media_stream_request.h"
 #include "url/origin.h"
 
@@ -111,9 +111,12 @@
   }
 
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = request_audio_input;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = request_video_input;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = request_audio_output;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] =
+      request_audio_input;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] =
+      request_video_input;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] =
+      request_audio_output;
 
   media_stream_manager_->media_devices_manager()->EnumerateDevices(
       render_process_id_, render_frame_id_, devices_to_enumerate,
@@ -176,9 +179,12 @@
   }
 
   MediaDevicesManager::BoolDeviceTypes devices_to_subscribe;
-  devices_to_subscribe[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = subscribe_audio_input;
-  devices_to_subscribe[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = subscribe_video_input;
-  devices_to_subscribe[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = subscribe_audio_output;
+  devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] =
+      subscribe_audio_input;
+  devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] =
+      subscribe_video_input;
+  devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] =
+      subscribe_audio_output;
 
   uint32_t subscription_id = media_stream_manager_->media_devices_manager()
                                  ->SubscribeDeviceChangeNotifications(
@@ -192,7 +198,8 @@
     MediaDeviceSaltAndOrigin salt_and_origin) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   GetDefaultMediaDeviceID(
-      MEDIA_DEVICE_TYPE_VIDEO_INPUT, render_process_id_, render_frame_id_,
+      blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT, render_process_id_,
+      render_frame_id_,
       base::Bind(&MediaDevicesDispatcherHost::GotDefaultVideoInputDeviceID,
                  weak_factory_.GetWeakPtr(), base::Passed(&client_callback),
                  std::move(salt_and_origin)));
@@ -206,7 +213,7 @@
   MediaDevicesManager::BoolDeviceTypes requested_types;
   // Also request audio devices to make sure the heuristic to determine
   // the video group ID works.
-  requested_types[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  requested_types[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
   media_stream_manager_->media_devices_manager()->EnumerateDevices(
       requested_types,
       base::BindOnce(
@@ -223,7 +230,8 @@
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   std::vector<blink::mojom::VideoInputDeviceCapabilitiesPtr>
       video_input_capabilities;
-  for (const auto& device_info : enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT]) {
+  for (const auto& device_info :
+       enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT]) {
     std::string hmac_device_id =
         GetHMACForMediaDeviceID(salt_and_origin.device_id_salt,
                                 salt_and_origin.origin, device_info.device_id);
@@ -318,7 +326,8 @@
 
   DCHECK(current_audio_input_capabilities_.empty());
   GetDefaultMediaDeviceID(
-      MEDIA_DEVICE_TYPE_AUDIO_INPUT, render_process_id_, render_frame_id_,
+      blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT, render_process_id_,
+      render_frame_id_,
       base::Bind(&MediaDevicesDispatcherHost::GotDefaultAudioInputDeviceID,
                  weak_factory_.GetWeakPtr()));
 }
@@ -329,7 +338,7 @@
   DCHECK_GT(pending_audio_input_capabilities_requests_.size(), 0U);
   DCHECK(current_audio_input_capabilities_.empty());
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
   media_stream_manager_->media_devices_manager()->EnumerateDevices(
       devices_to_enumerate,
       base::BindOnce(&MediaDevicesDispatcherHost::GotAudioInputEnumeration,
@@ -343,7 +352,8 @@
   DCHECK_GT(pending_audio_input_capabilities_requests_.size(), 0U);
   DCHECK(current_audio_input_capabilities_.empty());
   DCHECK_EQ(num_pending_audio_input_parameters_, 0U);
-  for (const auto& device_info : enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT]) {
+  for (const auto& device_info :
+       enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT]) {
     blink::mojom::AudioInputDeviceCapabilities capabilities(
         device_info.device_id, device_info.group_id,
         media::AudioParameters::UnavailableDeviceParams());
diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host.h b/content/browser/renderer_host/media/media_devices_dispatcher_host.h
index f112b46..c2525bef 100644
--- a/content/browser/renderer_host/media/media_devices_dispatcher_host.h
+++ b/content/browser/renderer_host/media/media_devices_dispatcher_host.h
@@ -15,7 +15,7 @@
 #include "content/browser/renderer_host/media/media_devices_manager.h"
 #include "content/common/content_export.h"
 #include "media/capture/video/video_capture_device_descriptor.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 #include "url/origin.h"
 
 namespace content {
diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc b/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
index 1d70504..9d67bfd 100644
--- a/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
@@ -68,7 +68,8 @@
   MockMediaDevicesListener() {}
 
   MOCK_METHOD2(OnDevicesChanged,
-               void(MediaDeviceType, const MediaDeviceInfoArray&));
+               void(blink::MediaDeviceType,
+                    const blink::WebMediaDeviceInfoArray&));
 
   blink::mojom::MediaDevicesListenerPtr CreateInterfacePtrAndBind() {
     blink::mojom::MediaDevicesListenerPtr listener;
@@ -144,24 +145,29 @@
 
     base::RunLoop run_loop;
     MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-    devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
-    devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
-    devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+    devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+    devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+    devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
     media_stream_manager_->media_devices_manager()->EnumerateDevices(
         devices_to_enumerate,
         base::BindOnce(&PhysicalDevicesEnumerated, run_loop.QuitClosure(),
                        &physical_devices_));
     run_loop.Run();
 
-    ASSERT_GT(physical_devices_[MEDIA_DEVICE_TYPE_AUDIO_INPUT].size(), 0u);
-    ASSERT_GT(physical_devices_[MEDIA_DEVICE_TYPE_VIDEO_INPUT].size(), 0u);
-    ASSERT_GT(physical_devices_[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size(), 0u);
+    ASSERT_GT(physical_devices_[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT].size(),
+              0u);
+    ASSERT_GT(physical_devices_[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT].size(),
+              0u);
+    ASSERT_GT(physical_devices_[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size(),
+              0u);
   }
 
-  MOCK_METHOD1(UniqueOriginCallback,
-               void(const std::vector<std::vector<MediaDeviceInfo>>&));
-  MOCK_METHOD1(ValidOriginCallback,
-               void(const std::vector<std::vector<MediaDeviceInfo>>&));
+  MOCK_METHOD1(
+      UniqueOriginCallback,
+      void(const std::vector<std::vector<blink::WebMediaDeviceInfo>>&));
+  MOCK_METHOD1(
+      ValidOriginCallback,
+      void(const std::vector<std::vector<blink::WebMediaDeviceInfo>>&));
   MOCK_METHOD0(MockVideoInputCapabilitiesCallback, void());
   MOCK_METHOD0(MockAudioInputCapabilitiesCallback, void());
   MOCK_METHOD0(MockAllVideoInputDeviceFormatsCallback, void());
@@ -233,7 +239,7 @@
  protected:
   void DevicesEnumerated(
       const base::Closure& closure,
-      const std::vector<std::vector<MediaDeviceInfo>>& devices,
+      const std::vector<std::vector<blink::WebMediaDeviceInfo>>& devices,
       std::vector<blink::mojom::VideoInputDeviceCapabilitiesPtr>
           video_input_capabilities) {
     enumerated_devices_ = devices;
@@ -257,19 +263,22 @@
 
     ASSERT_FALSE(enumerated_devices_.empty());
     if (enumerate_audio_input)
-      EXPECT_FALSE(enumerated_devices_[MEDIA_DEVICE_TYPE_AUDIO_INPUT].empty());
+      EXPECT_FALSE(
+          enumerated_devices_[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT].empty());
     if (enumerate_video_input)
-      EXPECT_FALSE(enumerated_devices_[MEDIA_DEVICE_TYPE_VIDEO_INPUT].empty());
+      EXPECT_FALSE(
+          enumerated_devices_[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT].empty());
     if (enumerate_audio_output)
-      EXPECT_FALSE(enumerated_devices_[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].empty());
+      EXPECT_FALSE(
+          enumerated_devices_[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].empty());
 
     EXPECT_FALSE(DoesContainRawIds(enumerated_devices_));
     EXPECT_TRUE(DoesEveryDeviceMapToRawId(enumerated_devices_, origin_));
   }
 
   bool DoesContainRawIds(
-      const std::vector<std::vector<MediaDeviceInfo>>& enumeration) {
-    for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
+      const std::vector<std::vector<blink::WebMediaDeviceInfo>>& enumeration) {
+    for (size_t i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i) {
       for (const auto& device_info : enumeration[i]) {
         for (const auto& raw_device_info : physical_devices_[i]) {
           // Skip default and communications audio devices, whose IDs are not
@@ -289,9 +298,9 @@
   }
 
   bool DoesEveryDeviceMapToRawId(
-      const std::vector<std::vector<MediaDeviceInfo>>& enumeration,
+      const std::vector<std::vector<blink::WebMediaDeviceInfo>>& enumeration,
       const url::Origin& origin) {
-    for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
+    for (size_t i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i) {
       for (const auto& device_info : enumeration[i]) {
         bool found_match = false;
         for (const auto& raw_device_info : physical_devices_[i]) {
@@ -310,7 +319,7 @@
   }
 
   // Returns true if all devices have labels, false otherwise.
-  bool DoesContainLabels(const MediaDeviceInfoArray& device_infos) {
+  bool DoesContainLabels(const blink::WebMediaDeviceInfoArray& device_infos) {
     for (const auto& device_info : device_infos) {
       if (device_info.label.empty())
         return false;
@@ -319,7 +328,8 @@
   }
 
   // Returns true if all devices have labels, false otherwise.
-  bool DoesContainLabels(const std::vector<MediaDeviceInfoArray>& enumeration) {
+  bool DoesContainLabels(
+      const std::vector<blink::WebMediaDeviceInfoArray>& enumeration) {
     for (const auto& device_infos : enumeration) {
       if (!DoesContainLabels(device_infos))
         return false;
@@ -328,7 +338,8 @@
   }
 
   // Returns true if no devices have labels, false otherwise.
-  bool DoesNotContainLabels(const MediaDeviceInfoArray& device_infos) {
+  bool DoesNotContainLabels(
+      const blink::WebMediaDeviceInfoArray& device_infos) {
     for (const auto& device_info : device_infos) {
       if (!device_info.label.empty())
         return false;
@@ -338,7 +349,7 @@
 
   // Returns true if no devices have labels, false otherwise.
   bool DoesNotContainLabels(
-      const std::vector<std::vector<MediaDeviceInfo>>& enumeration) {
+      const std::vector<std::vector<blink::WebMediaDeviceInfo>>& enumeration) {
     for (const auto& device_infos : enumeration) {
       if (!DoesNotContainLabels(device_infos))
         return false;
@@ -350,14 +361,14 @@
     media_stream_manager_->media_devices_manager()->SetPermissionChecker(
         std::make_unique<MediaDevicesPermissionChecker>(has_permission));
     MockMediaDevicesListener device_change_listener;
-    for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
-      MediaDeviceType type = static_cast<MediaDeviceType>(i);
+    for (size_t i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i) {
+      blink::MediaDeviceType type = static_cast<blink::MediaDeviceType>(i);
       host_->AddMediaDevicesListener(
-          type == MEDIA_DEVICE_TYPE_AUDIO_INPUT,
-          type == MEDIA_DEVICE_TYPE_VIDEO_INPUT,
-          type == MEDIA_DEVICE_TYPE_AUDIO_OUTPUT,
+          type == blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT,
+          type == blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT,
+          type == blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT,
           device_change_listener.CreateInterfacePtrAndBind());
-      MediaDeviceInfoArray changed_devices;
+      blink::WebMediaDeviceInfoArray changed_devices;
       EXPECT_CALL(device_change_listener, OnDevicesChanged(type, _))
           .WillRepeatedly(SaveArg<1>(&changed_devices));
 
@@ -396,7 +407,7 @@
   MediaDeviceEnumeration physical_devices_;
   url::Origin origin_;
 
-  std::vector<MediaDeviceInfoArray> enumerated_devices_;
+  std::vector<blink::WebMediaDeviceInfoArray> enumerated_devices_;
 };
 
 TEST_P(MediaDevicesDispatcherHostTest, EnumerateAudioInputDevices) {
diff --git a/content/browser/renderer_host/media/media_devices_manager.cc b/content/browser/renderer_host/media/media_devices_manager.cc
index 0d1b4f6..de7a5a5c 100644
--- a/content/browser/renderer_host/media/media_devices_manager.cc
+++ b/content/browser/renderer_host/media/media_devices_manager.cc
@@ -62,8 +62,9 @@
 
 // Private helper method to generate a string for the log message that lists the
 // human readable names of |devices|.
-std::string GetLogMessageString(MediaDeviceType device_type,
-                                const MediaDeviceInfoArray& device_infos) {
+std::string GetLogMessageString(
+    blink::MediaDeviceType device_type,
+    const blink::WebMediaDeviceInfoArray& device_infos) {
   std::string output_string =
       base::StringPrintf("Getting devices of type %d:\n", device_type);
   if (device_infos.empty())
@@ -73,8 +74,8 @@
   return output_string;
 }
 
-MediaDeviceInfoArray GetFakeAudioDevices(bool is_input) {
-  MediaDeviceInfoArray result;
+blink::WebMediaDeviceInfoArray GetFakeAudioDevices(bool is_input) {
+  blink::WebMediaDeviceInfoArray result;
   if (is_input) {
     result.emplace_back(media::AudioDeviceDescription::kDefaultDeviceId,
                         "Fake Default Audio Input",
@@ -122,8 +123,8 @@
          !media::AudioDeviceDescription::IsCommunicationsDevice(device_id);
 }
 
-static bool EqualDeviceAndGroupID(const MediaDeviceInfo& lhs,
-                                  const MediaDeviceInfo& rhs) {
+static bool EqualDeviceAndGroupID(const blink::WebMediaDeviceInfo& lhs,
+                                  const blink::WebMediaDeviceInfo& rhs) {
   return lhs == rhs && lhs.group_id == rhs.group_id;
 }
 
@@ -136,8 +137,8 @@
 
 }  // namespace
 
-std::string GuessVideoGroupID(const MediaDeviceInfoArray& audio_infos,
-                              const MediaDeviceInfo& video_info) {
+std::string GuessVideoGroupID(const blink::WebMediaDeviceInfoArray& audio_infos,
+                              const blink::WebMediaDeviceInfo& video_info) {
   const std::string video_label = VideoLabelWithoutModelID(video_info.label);
 
   // If |video_label| is very small, do not guess in order to avoid false
@@ -145,10 +146,10 @@
   if (video_label.size() <= 3)
     return video_info.device_id;
 
-  base::RepeatingCallback<bool(const MediaDeviceInfo&)>
+  base::RepeatingCallback<bool(const blink::WebMediaDeviceInfo&)>
       video_label_is_included_in_audio_label = base::BindRepeating(
           [](const std::string& video_label,
-             const MediaDeviceInfo& audio_info) {
+             const blink::WebMediaDeviceInfo& audio_info) {
             return audio_info.label.find(video_label) != std::string::npos;
           },
           base::ConstRef(video_label));
@@ -157,10 +158,10 @@
   std::string video_usb_model = video_has_usb_model
                                     ? GetUSBModelFromLabel(video_info.label)
                                     : std::string();
-  base::RepeatingCallback<bool(const MediaDeviceInfo&)> usb_model_matches =
-      base::BindRepeating(
+  base::RepeatingCallback<bool(const blink::WebMediaDeviceInfo&)>
+      usb_model_matches = base::BindRepeating(
           [](bool video_has_usb_model, const std::string& video_usb_model,
-             const MediaDeviceInfo& audio_info) {
+             const blink::WebMediaDeviceInfo& audio_info) {
             return video_has_usb_model && LabelHasUSBModel(audio_info.label)
                        ? video_usb_model ==
                              GetUSBModelFromLabel(audio_info.label)
@@ -173,10 +174,11 @@
     // The label for the default and communication audio devices may contain the
     // same label as the real devices, so they should be ignored when trying to
     // find unique matches.
-    auto real_device_matches = [callback](const MediaDeviceInfo& audio_info) {
-      return IsRealAudioDeviceID(audio_info.device_id) &&
-             (*callback).Run(audio_info);
-    };
+    auto real_device_matches =
+        [callback](const blink::WebMediaDeviceInfo& audio_info) {
+          return IsRealAudioDeviceID(audio_info.device_id) &&
+                 (*callback).Run(audio_info);
+        };
     auto it_first = std::find_if(audio_infos.begin(), audio_infos.end(),
                                  real_device_matches);
     if (it_first == audio_infos.end())
@@ -380,7 +382,7 @@
       stop_removed_input_device_cb_(std::move(stop_removed_input_device_cb)),
       ui_input_device_change_cb_(std::move(ui_input_device_change_cb)),
       permission_checker_(std::make_unique<MediaDevicesPermissionChecker>()),
-      cache_infos_(NUM_MEDIA_DEVICE_TYPES),
+      cache_infos_(blink::NUM_MEDIA_DEVICE_TYPES),
       monitoring_started_(false),
       salt_and_origin_callback_(
           base::BindRepeating(&GetMediaDeviceSaltAndOrigin)),
@@ -406,10 +408,10 @@
 
   requests_.emplace_back(requested_types, std::move(callback));
   bool all_results_cached = true;
-  for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
+  for (size_t i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i) {
     if (requested_types[i] && cache_policies_[i] == CachePolicy::NO_CACHE) {
       all_results_cached = false;
-      DoEnumerateDevices(static_cast<MediaDeviceType>(i));
+      DoEnumerateDevices(static_cast<blink::MediaDeviceType>(i));
     }
   }
 
@@ -463,7 +465,7 @@
   subscriptions_.erase(subscription_id);
 }
 
-void MediaDevicesManager::SetCachePolicy(MediaDeviceType type,
+void MediaDevicesManager::SetCachePolicy(blink::MediaDeviceType type,
                                          CachePolicy policy) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(IsValidMediaDeviceType(type));
@@ -512,9 +514,9 @@
   base::SystemMonitor::Get()->AddDevicesChangedObserver(this);
 
   if (base::FeatureList::IsEnabled(features::kMediaDevicesSystemMonitorCache)) {
-    for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
+    for (size_t i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i) {
       DCHECK(cache_policies_[i] != CachePolicy::SYSTEM_MONITOR);
-      SetCachePolicy(static_cast<MediaDeviceType>(i),
+      SetCachePolicy(static_cast<blink::MediaDeviceType>(i),
                      CachePolicy::SYSTEM_MONITOR);
     }
   }
@@ -544,8 +546,9 @@
   base::SystemMonitor::Get()->RemoveDevicesChangedObserver(this);
   audio_service_device_listener_.reset();
   monitoring_started_ = false;
-  for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i)
-    SetCachePolicy(static_cast<MediaDeviceType>(i), CachePolicy::NO_CACHE);
+  for (size_t i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i)
+    SetCachePolicy(static_cast<blink::MediaDeviceType>(i),
+                   CachePolicy::NO_CACHE);
 }
 
 bool MediaDevicesManager::IsMonitoringStarted() {
@@ -558,11 +561,11 @@
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   switch (device_type) {
     case base::SystemMonitor::DEVTYPE_AUDIO:
-      HandleDevicesChanged(MEDIA_DEVICE_TYPE_AUDIO_INPUT);
-      HandleDevicesChanged(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT);
+      HandleDevicesChanged(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT);
+      HandleDevicesChanged(blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT);
       break;
     case base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE:
-      HandleDevicesChanged(MEDIA_DEVICE_TYPE_VIDEO_INPUT);
+      HandleDevicesChanged(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT);
       break;
     default:
       break;  // Uninteresting device change.
@@ -608,8 +611,8 @@
   return formats;
 }
 
-MediaDeviceInfoArray MediaDevicesManager::GetCachedDeviceInfo(
-    MediaDeviceType type) {
+blink::WebMediaDeviceInfoArray MediaDevicesManager::GetCachedDeviceInfo(
+    blink::MediaDeviceType type) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   return current_snapshot_[type];
 }
@@ -657,13 +660,13 @@
   // TODO(crbug.com/627793): Remove |internal_requested_types| and use
   // |requested_types| directly when video capture supports group IDs.
   BoolDeviceTypes internal_requested_types;
-  internal_requested_types[MEDIA_DEVICE_TYPE_AUDIO_INPUT] =
-      requested_types[MEDIA_DEVICE_TYPE_AUDIO_INPUT] ||
-      requested_types[MEDIA_DEVICE_TYPE_VIDEO_INPUT];
-  internal_requested_types[MEDIA_DEVICE_TYPE_VIDEO_INPUT] =
-      requested_types[MEDIA_DEVICE_TYPE_VIDEO_INPUT];
-  internal_requested_types[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] =
-      requested_types[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT];
+  internal_requested_types[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] =
+      requested_types[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] ||
+      requested_types[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT];
+  internal_requested_types[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] =
+      requested_types[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT];
+  internal_requested_types[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] =
+      requested_types[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT];
 
   EnumerateDevices(
       internal_requested_types,
@@ -682,11 +685,12 @@
     const MediaDeviceEnumeration& enumeration) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   const bool video_input_capabilities_requested =
-      has_permissions[MEDIA_DEVICE_TYPE_VIDEO_INPUT] &&
+      has_permissions[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] &&
       request_video_input_capabilities;
 
-  std::vector<MediaDeviceInfoArray> result(NUM_MEDIA_DEVICE_TYPES);
-  for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
+  std::vector<blink::WebMediaDeviceInfoArray> result(
+      blink::NUM_MEDIA_DEVICE_TYPES);
+  for (size_t i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i) {
     if (!requested_types[i])
       continue;
 
@@ -696,18 +700,18 @@
     }
   }
 
-  std::move(callback).Run(result,
-                          video_input_capabilities_requested
-                              ? ComputeVideoInputCapabilities(
-                                    enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT],
-                                    result[MEDIA_DEVICE_TYPE_VIDEO_INPUT])
-                              : std::vector<VideoInputDeviceCapabilitiesPtr>());
+  std::move(callback).Run(
+      result, video_input_capabilities_requested
+                  ? ComputeVideoInputCapabilities(
+                        enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT],
+                        result[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT])
+                  : std::vector<VideoInputDeviceCapabilitiesPtr>());
 }
 
 std::vector<VideoInputDeviceCapabilitiesPtr>
 MediaDevicesManager::ComputeVideoInputCapabilities(
-    const MediaDeviceInfoArray& raw_device_infos,
-    const MediaDeviceInfoArray& translated_device_infos) {
+    const blink::WebMediaDeviceInfoArray& raw_device_infos,
+    const blink::WebMediaDeviceInfoArray& translated_device_infos) {
   DCHECK_EQ(raw_device_infos.size(), translated_device_infos.size());
   std::vector<VideoInputDeviceCapabilitiesPtr> video_input_capabilities;
   for (size_t i = 0; i < raw_device_infos.size(); ++i) {
@@ -722,7 +726,7 @@
   return video_input_capabilities;
 }
 
-void MediaDevicesManager::DoEnumerateDevices(MediaDeviceType type) {
+void MediaDevicesManager::DoEnumerateDevices(blink::MediaDeviceType type) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(IsValidMediaDeviceType(type));
   CacheInfo& cache_info = cache_infos_[type];
@@ -731,15 +735,15 @@
 
   cache_info.UpdateStarted();
   switch (type) {
-    case MEDIA_DEVICE_TYPE_AUDIO_INPUT:
+    case blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT:
       EnumerateAudioDevices(true /* is_input */);
       break;
-    case MEDIA_DEVICE_TYPE_VIDEO_INPUT:
+    case blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT:
       video_capture_manager_->EnumerateDevices(
           base::BindOnce(&MediaDevicesManager::VideoInputDevicesEnumerated,
                          weak_factory_.GetWeakPtr()));
       break;
-    case MEDIA_DEVICE_TYPE_AUDIO_OUTPUT:
+    case blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT:
       EnumerateAudioDevices(false /* is_input */);
       break;
     default:
@@ -749,8 +753,9 @@
 
 void MediaDevicesManager::EnumerateAudioDevices(bool is_input) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  MediaDeviceType type =
-      is_input ? MEDIA_DEVICE_TYPE_AUDIO_INPUT : MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
+  blink::MediaDeviceType type = is_input
+                                    ? blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT
+                                    : blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
   if (use_fake_devices_) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE, base::BindOnce(&MediaDevicesManager::DevicesEnumerated,
@@ -767,19 +772,19 @@
 void MediaDevicesManager::VideoInputDevicesEnumerated(
     const media::VideoCaptureDeviceDescriptors& descriptors) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  MediaDeviceInfoArray snapshot;
+  blink::WebMediaDeviceInfoArray snapshot;
   for (const auto& descriptor : descriptors) {
     snapshot.emplace_back(descriptor);
   }
-  DevicesEnumerated(MEDIA_DEVICE_TYPE_VIDEO_INPUT, snapshot);
+  DevicesEnumerated(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT, snapshot);
 }
 
 void MediaDevicesManager::AudioDevicesEnumerated(
-    MediaDeviceType type,
+    blink::MediaDeviceType type,
     media::AudioDeviceDescriptions device_descriptions) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
-  MediaDeviceInfoArray snapshot;
+  blink::WebMediaDeviceInfoArray snapshot;
   for (const media::AudioDeviceDescription& description : device_descriptions) {
     snapshot.emplace_back(description.unique_id, description.device_name,
                           description.group_id,
@@ -789,8 +794,8 @@
 }
 
 void MediaDevicesManager::DevicesEnumerated(
-    MediaDeviceType type,
-    const MediaDeviceInfoArray& snapshot) {
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfoArray& snapshot) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(IsValidMediaDeviceType(type));
   UpdateSnapshot(type, snapshot);
@@ -815,38 +820,39 @@
 }
 
 void MediaDevicesManager::UpdateSnapshot(
-    MediaDeviceType type,
-    const MediaDeviceInfoArray& new_snapshot,
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfoArray& new_snapshot,
     bool ignore_group_id) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(IsValidMediaDeviceType(type));
 
   bool need_update_device_change_subscribers = false;
-  MediaDeviceInfoArray& old_snapshot = current_snapshot_[type];
+  blink::WebMediaDeviceInfoArray& old_snapshot = current_snapshot_[type];
 
-  if (type == MEDIA_DEVICE_TYPE_AUDIO_INPUT ||
-      type == MEDIA_DEVICE_TYPE_VIDEO_INPUT) {
+  if (type == blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT ||
+      type == blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT) {
     MaybeStopRemovedInputDevices(type, new_snapshot);
   }
 
   // Update the cached snapshot and send notifications only if the device list
   // has changed.
   if (old_snapshot.size() != new_snapshot.size() ||
-      !std::equal(new_snapshot.begin(), new_snapshot.end(),
-                  old_snapshot.begin(),
-                  ignore_group_id
-                      ? [](const MediaDeviceInfo& lhs,
-                           const MediaDeviceInfo& rhs) { return lhs == rhs; }
-                      : EqualDeviceAndGroupID)) {
+      !std::equal(
+          new_snapshot.begin(), new_snapshot.end(), old_snapshot.begin(),
+          ignore_group_id
+              ? [](const blink::WebMediaDeviceInfo& lhs,
+                   const blink::WebMediaDeviceInfo& rhs) { return lhs == rhs; }
+              : EqualDeviceAndGroupID)) {
     // Prevent sending notifications until group IDs are updated using
     // a heuristic in ProcessRequests().
     // TODO(crbug.com/627793): Remove |is_video_with_group_ids| and the
     // corresponding checks when the video-capture subsystem supports
     // group IDs.
     bool is_video_with_good_group_ids =
-        type == MEDIA_DEVICE_TYPE_VIDEO_INPUT &&
+        type == blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT &&
         (new_snapshot.size() == 0 || !new_snapshot[0].group_id.empty());
-    if (type == MEDIA_DEVICE_TYPE_AUDIO_INPUT || is_video_with_good_group_ids)
+    if (type == blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT ||
+        is_video_with_good_group_ids)
       ui_input_device_change_cb_.Run(type, new_snapshot);
 
     // Do not notify device-change subscribers after the first enumeration
@@ -854,7 +860,8 @@
     need_update_device_change_subscribers =
         has_seen_result_[type] &&
         (old_snapshot.size() != 0 || new_snapshot.size() != 0) &&
-        (type != MEDIA_DEVICE_TYPE_VIDEO_INPUT || is_video_with_good_group_ids);
+        (type != blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT ||
+         is_video_with_good_group_ids);
     current_snapshot_[type] = new_snapshot;
   }
 
@@ -868,14 +875,15 @@
   // for device coincidences with audio input devices.
   // TODO(crbug.com/627793): Remove this once the video-capture subsystem
   // supports group IDs.
-  if (has_seen_result_[MEDIA_DEVICE_TYPE_VIDEO_INPUT]) {
-    MediaDeviceInfoArray video_devices =
-        current_snapshot_[MEDIA_DEVICE_TYPE_VIDEO_INPUT];
+  if (has_seen_result_[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT]) {
+    blink::WebMediaDeviceInfoArray video_devices =
+        current_snapshot_[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT];
     for (auto& video_device_info : video_devices) {
       video_device_info.group_id = GuessVideoGroupID(
-          current_snapshot_[MEDIA_DEVICE_TYPE_AUDIO_INPUT], video_device_info);
+          current_snapshot_[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT],
+          video_device_info);
     }
-    UpdateSnapshot(MEDIA_DEVICE_TYPE_VIDEO_INPUT, video_devices,
+    UpdateSnapshot(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT, video_devices,
                    false /* ignore_group_id */);
   }
 
@@ -895,7 +903,7 @@
     const EnumerationRequest& request_info) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   bool is_ready = true;
-  for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
+  for (size_t i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i) {
     if (!request_info.requested[i])
       continue;
     switch (cache_policies_[i]) {
@@ -914,7 +922,7 @@
   return is_ready;
 }
 
-void MediaDevicesManager::HandleDevicesChanged(MediaDeviceType type) {
+void MediaDevicesManager::HandleDevicesChanged(blink::MediaDeviceType type) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(IsValidMediaDeviceType(type));
   cache_infos_[type].InvalidateCache();
@@ -922,17 +930,18 @@
 }
 
 void MediaDevicesManager::MaybeStopRemovedInputDevices(
-    MediaDeviceType type,
-    const MediaDeviceInfoArray& new_snapshot) {
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfoArray& new_snapshot) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  DCHECK(type == MEDIA_DEVICE_TYPE_AUDIO_INPUT ||
-         type == MEDIA_DEVICE_TYPE_VIDEO_INPUT);
+  DCHECK(type == blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT ||
+         type == blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT);
 
   for (const auto& old_device_info : current_snapshot_[type]) {
-    auto it = std::find_if(new_snapshot.begin(), new_snapshot.end(),
-                           [&old_device_info](const MediaDeviceInfo& info) {
-                             return info.device_id == old_device_info.device_id;
-                           });
+    auto it =
+        std::find_if(new_snapshot.begin(), new_snapshot.end(),
+                     [&old_device_info](const blink::WebMediaDeviceInfo& info) {
+                       return info.device_id == old_device_info.device_id;
+                     });
 
     // If a device was removed, notify the MediaStreamManager to stop all
     // streams using that device.
@@ -942,8 +951,8 @@
 }
 
 void MediaDevicesManager::NotifyDeviceChangeSubscribers(
-    MediaDeviceType type,
-    const MediaDeviceInfoArray& snapshot) {
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfoArray& snapshot) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(IsValidMediaDeviceType(type));
 
@@ -968,8 +977,8 @@
     uint32_t subscription_id,
     int render_process_id,
     int render_frame_id,
-    MediaDeviceType type,
-    const MediaDeviceInfoArray& device_infos,
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfoArray& device_infos,
     MediaDeviceSaltAndOrigin salt_and_origin) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   permission_checker_->CheckPermission(
@@ -981,8 +990,8 @@
 
 void MediaDevicesManager::NotifyDeviceChange(
     uint32_t subscription_id,
-    MediaDeviceType type,
-    const MediaDeviceInfoArray& device_infos,
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfoArray& device_infos,
     const MediaDeviceSaltAndOrigin& salt_and_origin,
     bool has_permission) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
diff --git a/content/browser/renderer_host/media/media_devices_manager.h b/content/browser/renderer_host/media/media_devices_manager.h
index 2a4b6cf..1c0e8bd 100644
--- a/content/browser/renderer_host/media/media_devices_manager.h
+++ b/content/browser/renderer_host/media/media_devices_manager.h
@@ -18,11 +18,11 @@
 #include "base/system/system_monitor.h"
 #include "content/browser/media/media_devices_util.h"
 #include "content/common/content_export.h"
-#include "content/common/media/media_devices.h"
 #include "media/audio/audio_device_description.h"
 #include "media/capture/video/video_capture_device_descriptor.h"
 #include "media/capture/video_capture_types.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 
 using blink::mojom::VideoInputDeviceCapabilitiesPtr;
 
@@ -39,9 +39,9 @@
 class MediaDevicesPermissionChecker;
 class VideoCaptureManager;
 
-// Use MediaDeviceType values to index on this type.
+// Use blink::MediaDeviceType values to index on this type.
 using MediaDeviceEnumeration =
-    std::array<MediaDeviceInfoArray, NUM_MEDIA_DEVICE_TYPES>;
+    std::array<blink::WebMediaDeviceInfoArray, blink::NUM_MEDIA_DEVICE_TYPES>;
 
 // MediaDevicesManager is responsible for doing media-device enumerations.
 // In addition it implements caching for enumeration results and device
@@ -50,25 +50,25 @@
 class CONTENT_EXPORT MediaDevicesManager
     : public base::SystemMonitor::DevicesChangedObserver {
  public:
-  // Use MediaDeviceType values to index on this type. By default all device
-  // types are false.
+  // Use blink::MediaDeviceType values to index on this type. By default all
+  // device types are false.
   class BoolDeviceTypes final
-      : public std::array<bool, NUM_MEDIA_DEVICE_TYPES> {
+      : public std::array<bool, blink::NUM_MEDIA_DEVICE_TYPES> {
    public:
     BoolDeviceTypes() { fill(false); }
   };
 
   using EnumerationCallback =
       base::OnceCallback<void(const MediaDeviceEnumeration&)>;
-  using EnumerateDevicesCallback =
-      base::OnceCallback<void(const std::vector<MediaDeviceInfoArray>&,
-                              std::vector<VideoInputDeviceCapabilitiesPtr>)>;
-  using StopRemovedInputDeviceCallback =
-      base::RepeatingCallback<void(MediaDeviceType type,
-                                   const MediaDeviceInfo& media_device_info)>;
-  using UIInputDeviceChangeCallback =
-      base::RepeatingCallback<void(MediaDeviceType stream_type,
-                                   const MediaDeviceInfoArray& devices)>;
+  using EnumerateDevicesCallback = base::OnceCallback<void(
+      const std::vector<blink::WebMediaDeviceInfoArray>&,
+      std::vector<VideoInputDeviceCapabilitiesPtr>)>;
+  using StopRemovedInputDeviceCallback = base::RepeatingCallback<void(
+      blink::MediaDeviceType type,
+      const blink::WebMediaDeviceInfo& media_device_info)>;
+  using UIInputDeviceChangeCallback = base::RepeatingCallback<void(
+      blink::MediaDeviceType stream_type,
+      const blink::WebMediaDeviceInfoArray& devices)>;
 
   MediaDevicesManager(
       media::AudioSystem* audio_system,
@@ -134,7 +134,8 @@
   // TODO(guidou): Remove this function once content::GetMediaDeviceIDForHMAC
   // is rewritten to receive devices via a callback.
   // See http://crbug.com/648155.
-  MediaDeviceInfoArray GetCachedDeviceInfo(MediaDeviceType type);
+  blink::WebMediaDeviceInfoArray GetCachedDeviceInfo(
+      blink::MediaDeviceType type);
 
   MediaDevicesPermissionChecker* media_devices_permission_checker();
 
@@ -182,7 +183,7 @@
   };
 
   // Manually sets a caching policy for a given device type.
-  void SetCachePolicy(MediaDeviceType type, CachePolicy policy);
+  void SetCachePolicy(blink::MediaDeviceType type, CachePolicy policy);
 
   // Helpers to handle enumeration results for a renderer process.
   void CheckPermissionsForEnumerateDevices(
@@ -207,11 +208,11 @@
       const MediaDeviceEnumeration& enumeration);
 
   std::vector<VideoInputDeviceCapabilitiesPtr> ComputeVideoInputCapabilities(
-      const MediaDeviceInfoArray& raw_device_infos,
-      const MediaDeviceInfoArray& translated_device_infos);
+      const blink::WebMediaDeviceInfoArray& raw_device_infos,
+      const blink::WebMediaDeviceInfoArray& translated_device_infos);
 
   // Helpers to issue low-level device enumerations.
-  void DoEnumerateDevices(MediaDeviceType type);
+  void DoEnumerateDevices(blink::MediaDeviceType type);
   void EnumerateAudioDevices(bool is_input);
 
   // Callback for VideoCaptureManager::EnumerateDevices.
@@ -220,33 +221,36 @@
 
   // Callback for AudioSystem::GetDeviceDescriptions.
   void AudioDevicesEnumerated(
-      MediaDeviceType type,
+      blink::MediaDeviceType type,
       media::AudioDeviceDescriptions device_descriptions);
 
   // Helpers to handle enumeration results.
-  void DevicesEnumerated(MediaDeviceType type,
-                         const MediaDeviceInfoArray& snapshot);
-  void UpdateSnapshot(MediaDeviceType type,
-                      const MediaDeviceInfoArray& new_snapshot,
+  void DevicesEnumerated(blink::MediaDeviceType type,
+                         const blink::WebMediaDeviceInfoArray& snapshot);
+  void UpdateSnapshot(blink::MediaDeviceType type,
+                      const blink::WebMediaDeviceInfoArray& new_snapshot,
                       bool ignore_group_id = true);
   void ProcessRequests();
   bool IsEnumerationRequestReady(const EnumerationRequest& request_info);
 
   // Helpers to handle device-change notification.
-  void HandleDevicesChanged(MediaDeviceType type);
-  void MaybeStopRemovedInputDevices(MediaDeviceType type,
-                                    const MediaDeviceInfoArray& new_snapshot);
-  void NotifyDeviceChangeSubscribers(MediaDeviceType type,
-                                     const MediaDeviceInfoArray& snapshot);
-  void CheckPermissionForDeviceChange(uint32_t subscription_id,
-                                      int render_process_id,
-                                      int render_frame_id,
-                                      MediaDeviceType type,
-                                      const MediaDeviceInfoArray& device_infos,
-                                      MediaDeviceSaltAndOrigin salt_and_origin);
+  void HandleDevicesChanged(blink::MediaDeviceType type);
+  void MaybeStopRemovedInputDevices(
+      blink::MediaDeviceType type,
+      const blink::WebMediaDeviceInfoArray& new_snapshot);
+  void NotifyDeviceChangeSubscribers(
+      blink::MediaDeviceType type,
+      const blink::WebMediaDeviceInfoArray& snapshot);
+  void CheckPermissionForDeviceChange(
+      uint32_t subscription_id,
+      int render_process_id,
+      int render_frame_id,
+      blink::MediaDeviceType type,
+      const blink::WebMediaDeviceInfoArray& device_infos,
+      MediaDeviceSaltAndOrigin salt_and_origin);
   void NotifyDeviceChange(uint32_t subscription_id,
-                          MediaDeviceType type,
-                          const MediaDeviceInfoArray& device_infos,
+                          blink::MediaDeviceType type,
+                          const blink::WebMediaDeviceInfoArray& device_infos,
                           const MediaDeviceSaltAndOrigin& salt_and_origin,
                           bool has_permission);
 
@@ -262,7 +266,7 @@
 
   std::unique_ptr<MediaDevicesPermissionChecker> permission_checker_;
 
-  using CachePolicies = std::array<CachePolicy, NUM_MEDIA_DEVICE_TYPES>;
+  using CachePolicies = std::array<CachePolicy, blink::NUM_MEDIA_DEVICE_TYPES>;
   CachePolicies cache_policies_;
 
   class CacheInfo;
@@ -300,8 +304,8 @@
 // TODO(crbug.com/627793): Replace the heuristic with proper associations
 // provided by the OS.
 CONTENT_EXPORT std::string GuessVideoGroupID(
-    const MediaDeviceInfoArray& audio_infos,
-    const MediaDeviceInfo& video_info);
+    const blink::WebMediaDeviceInfoArray& audio_infos,
+    const blink::WebMediaDeviceInfo& video_info);
 
 }  // namespace content
 
diff --git a/content/browser/renderer_host/media/media_devices_manager_unittest.cc b/content/browser/renderer_host/media/media_devices_manager_unittest.cc
index 6fd207b..29852c6d 100644
--- a/content/browser/renderer_host/media/media_devices_manager_unittest.cc
+++ b/content/browser/renderer_host/media/media_devices_manager_unittest.cc
@@ -138,7 +138,8 @@
   MockMediaDevicesListener() {}
 
   MOCK_METHOD2(OnDevicesChanged,
-               void(MediaDeviceType, const MediaDeviceInfoArray&));
+               void(blink::MediaDeviceType,
+                    const blink::WebMediaDeviceInfoArray&));
 
   blink::mojom::MediaDevicesListenerPtr CreateInterfacePtrAndBind() {
     blink::mojom::MediaDevicesListenerPtr listener;
@@ -153,14 +154,15 @@
 class MockMediaDevicesManagerClient {
  public:
   MOCK_METHOD2(StopRemovedInputDevice,
-               void(MediaDeviceType type,
-                    const MediaDeviceInfo& media_device_info));
+               void(blink::MediaDeviceType type,
+                    const blink::WebMediaDeviceInfo& media_device_info));
   MOCK_METHOD2(InputDevicesChangedUI,
-               void(MediaDeviceType stream_type,
-                    const MediaDeviceInfoArray& devices));
+               void(blink::MediaDeviceType stream_type,
+                    const blink::WebMediaDeviceInfoArray& devices));
 };
 
-void VerifyDeviceAndGroupID(const std::vector<MediaDeviceInfoArray>& array) {
+void VerifyDeviceAndGroupID(
+    const std::vector<blink::WebMediaDeviceInfoArray>& array) {
   for (const auto& device_infos : array) {
     for (const auto& device_info : device_infos) {
       EXPECT_FALSE(device_info.device_id.empty());
@@ -182,7 +184,7 @@
 
   void EnumerateCallback(base::RunLoop* run_loop,
                          const MediaDeviceEnumeration& result) {
-    for (int i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
+    for (int i = 0; i < blink::NUM_MEDIA_DEVICE_TYPES; ++i) {
       for (const auto& device_info : result[i]) {
         EXPECT_FALSE(device_info.device_id.empty());
         EXPECT_FALSE(device_info.group_id.empty());
@@ -196,7 +198,7 @@
       const std::vector<media::FakeVideoCaptureDeviceSettings>&
           expected_video_capture_device_settings,
       base::RunLoop* run_loop,
-      const std::vector<MediaDeviceInfoArray>& devices,
+      const std::vector<blink::WebMediaDeviceInfoArray>& devices,
       std::vector<VideoInputDeviceCapabilitiesPtr> capabilities) {
     EXPECT_EQ(capabilities.size(),
               expected_video_capture_device_settings.size());
@@ -243,7 +245,7 @@
         std::make_unique<MediaDevicesPermissionChecker>(true));
   }
 
-  void EnableCache(MediaDeviceType type) {
+  void EnableCache(blink::MediaDeviceType type) {
     media_devices_manager_->SetCachePolicy(
         type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR);
   }
@@ -273,7 +275,7 @@
   EXPECT_CALL(*this, MockCallback(_)).Times(kNumCalls);
   EXPECT_CALL(media_devices_manager_client_, InputDevicesChangedUI(_, _));
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -292,7 +294,7 @@
   EXPECT_CALL(*this, MockCallback(_)).Times(kNumCalls);
   EXPECT_CALL(media_devices_manager_client_, InputDevicesChangedUI(_, _));
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -311,7 +313,7 @@
       .Times(kNumCalls);
   EXPECT_CALL(*this, MockCallback(_)).Times(kNumCalls);
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -330,8 +332,8 @@
   EXPECT_CALL(*this, MockCallback(_)).Times(kNumCalls);
   EXPECT_CALL(media_devices_manager_client_, InputDevicesChangedUI(_, _));
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -349,11 +351,11 @@
   EXPECT_CALL(*audio_manager_, MockGetAudioOutputDeviceNames(_)).Times(1);
   EXPECT_CALL(*this, MockCallback(_)).Times(kNumCalls);
   EXPECT_CALL(media_devices_manager_client_, InputDevicesChangedUI(_, _));
-  EnableCache(MEDIA_DEVICE_TYPE_AUDIO_INPUT);
-  EnableCache(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT);
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -371,9 +373,9 @@
   EXPECT_CALL(*audio_manager_, MockGetAudioOutputDeviceNames(_)).Times(0);
   EXPECT_CALL(*this, MockCallback(_)).Times(kNumCalls);
   EXPECT_CALL(media_devices_manager_client_, InputDevicesChangedUI(_, _));
-  EnableCache(MEDIA_DEVICE_TYPE_VIDEO_INPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT);
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -398,11 +400,11 @@
   size_t num_audio_output_devices = 3;
   audio_manager_->SetNumAudioInputDevices(num_audio_input_devices);
   audio_manager_->SetNumAudioOutputDevices(num_audio_output_devices);
-  EnableCache(MEDIA_DEVICE_TYPE_AUDIO_INPUT);
-  EnableCache(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT);
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -411,9 +413,9 @@
                        base::Unretained(this), &run_loop));
     run_loop.Run();
     EXPECT_EQ(num_audio_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
     EXPECT_EQ(num_audio_output_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
   }
 
   // Simulate removal of devices.
@@ -438,9 +440,9 @@
                        base::Unretained(this), &run_loop));
     run_loop.Run();
     EXPECT_EQ(num_audio_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
     EXPECT_EQ(num_audio_output_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
   }
 
   // Simulate addition of devices.
@@ -461,9 +463,9 @@
                        base::Unretained(this), &run_loop));
     run_loop.Run();
     EXPECT_EQ(num_audio_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
     EXPECT_EQ(num_audio_output_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
   }
 }
 
@@ -482,9 +484,9 @@
   size_t num_video_input_devices = 5;
   video_capture_device_factory_->SetToDefaultDevicesConfig(
       num_video_input_devices);
-  EnableCache(MEDIA_DEVICE_TYPE_VIDEO_INPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT);
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -493,7 +495,7 @@
                        base::Unretained(this), &run_loop));
     run_loop.Run();
     EXPECT_EQ(num_video_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
   }
 
   // Simulate addition of devices.
@@ -514,7 +516,7 @@
                        base::Unretained(this), &run_loop));
     run_loop.Run();
     EXPECT_EQ(num_video_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
   }
 
   // Simulate removal of devices.
@@ -539,7 +541,7 @@
                        base::Unretained(this), &run_loop));
     run_loop.Run();
     EXPECT_EQ(num_video_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
   }
 }
 
@@ -562,13 +564,13 @@
   video_capture_device_factory_->SetToDefaultDevicesConfig(
       num_video_input_devices);
   audio_manager_->SetNumAudioOutputDevices(num_audio_output_devices);
-  EnableCache(MEDIA_DEVICE_TYPE_AUDIO_INPUT);
-  EnableCache(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT);
-  EnableCache(MEDIA_DEVICE_TYPE_VIDEO_INPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT);
+  EnableCache(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT);
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   for (int i = 0; i < kNumCalls; i++) {
     base::RunLoop run_loop;
     media_devices_manager_->EnumerateDevices(
@@ -577,11 +579,11 @@
                        base::Unretained(this), &run_loop));
     run_loop.Run();
     EXPECT_EQ(num_audio_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
     EXPECT_EQ(num_video_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
     EXPECT_EQ(num_audio_output_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
   }
 
   // Simulate device changes
@@ -615,11 +617,11 @@
                        base::Unretained(this), &run_loop));
     run_loop.Run();
     EXPECT_EQ(num_audio_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT].size());
     EXPECT_EQ(num_video_input_devices,
-              enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT].size());
     EXPECT_EQ(num_audio_output_devices,
-              enumeration[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
+              enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT].size());
   }
 }
 
@@ -643,9 +645,9 @@
   // configuration.
   EXPECT_CALL(*this, MockCallback(_));
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   base::RunLoop run_loop;
   media_devices_manager_->EnumerateDevices(
       devices_to_enumerate,
@@ -656,7 +658,7 @@
   // Add device-change event listeners.
   MockMediaDevicesListener listener_audio_input;
   MediaDevicesManager::BoolDeviceTypes audio_input_devices_to_subscribe;
-  audio_input_devices_to_subscribe[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  audio_input_devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
   uint32_t audio_input_subscription_id =
       media_devices_manager_->SubscribeDeviceChangeNotifications(
           kRenderProcessId, kRenderFrameId, audio_input_devices_to_subscribe,
@@ -664,7 +666,7 @@
 
   MockMediaDevicesListener listener_video_input;
   MediaDevicesManager::BoolDeviceTypes video_input_devices_to_subscribe;
-  video_input_devices_to_subscribe[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  video_input_devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
   uint32_t video_input_subscription_id =
       media_devices_manager_->SubscribeDeviceChangeNotifications(
           kRenderProcessId, kRenderFrameId, video_input_devices_to_subscribe,
@@ -672,7 +674,8 @@
 
   MockMediaDevicesListener listener_audio_output;
   MediaDevicesManager::BoolDeviceTypes audio_output_devices_to_subscribe;
-  audio_output_devices_to_subscribe[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  audio_output_devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] =
+      true;
   uint32_t audio_output_subscription_id =
       media_devices_manager_->SubscribeDeviceChangeNotifications(
           kRenderProcessId, kRenderFrameId, audio_output_devices_to_subscribe,
@@ -680,38 +683,41 @@
 
   MockMediaDevicesListener listener_all;
   MediaDevicesManager::BoolDeviceTypes all_devices_to_subscribe;
-  all_devices_to_subscribe[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
-  all_devices_to_subscribe[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
-  all_devices_to_subscribe[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  all_devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+  all_devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  all_devices_to_subscribe[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   media_devices_manager_->SubscribeDeviceChangeNotifications(
       kRenderProcessId, kRenderFrameId, all_devices_to_subscribe,
       listener_all.CreateInterfacePtrAndBind());
 
-  MediaDeviceInfoArray notification_audio_input;
-  MediaDeviceInfoArray notification_video_input;
-  MediaDeviceInfoArray notification_audio_output;
-  MediaDeviceInfoArray notification_all_audio_input;
-  MediaDeviceInfoArray notification_all_video_input;
-  MediaDeviceInfoArray notification_all_audio_output;
+  blink::WebMediaDeviceInfoArray notification_audio_input;
+  blink::WebMediaDeviceInfoArray notification_video_input;
+  blink::WebMediaDeviceInfoArray notification_audio_output;
+  blink::WebMediaDeviceInfoArray notification_all_audio_input;
+  blink::WebMediaDeviceInfoArray notification_all_video_input;
+  blink::WebMediaDeviceInfoArray notification_all_audio_output;
   EXPECT_CALL(listener_audio_input,
-              OnDevicesChanged(MEDIA_DEVICE_TYPE_AUDIO_INPUT, _))
+              OnDevicesChanged(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT, _))
       .Times(1)
       .WillOnce(SaveArg<1>(&notification_audio_input));
   EXPECT_CALL(listener_video_input,
-              OnDevicesChanged(MEDIA_DEVICE_TYPE_VIDEO_INPUT, _))
+              OnDevicesChanged(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT, _))
       .Times(1)
       .WillOnce(SaveArg<1>(&notification_video_input));
   EXPECT_CALL(listener_audio_output,
-              OnDevicesChanged(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, _))
+              OnDevicesChanged(blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, _))
       .Times(1)
       .WillOnce(SaveArg<1>(&notification_audio_output));
-  EXPECT_CALL(listener_all, OnDevicesChanged(MEDIA_DEVICE_TYPE_AUDIO_INPUT, _))
+  EXPECT_CALL(listener_all,
+              OnDevicesChanged(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT, _))
       .Times(2)
       .WillRepeatedly(SaveArg<1>(&notification_all_audio_input));
-  EXPECT_CALL(listener_all, OnDevicesChanged(MEDIA_DEVICE_TYPE_VIDEO_INPUT, _))
+  EXPECT_CALL(listener_all,
+              OnDevicesChanged(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT, _))
       .Times(2)
       .WillRepeatedly(SaveArg<1>(&notification_all_video_input));
-  EXPECT_CALL(listener_all, OnDevicesChanged(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, _))
+  EXPECT_CALL(listener_all,
+              OnDevicesChanged(blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, _))
       .Times(2)
       .WillRepeatedly(SaveArg<1>(&notification_all_audio_output));
 
@@ -792,10 +798,10 @@
   // Audio is enumerated due to heuristics to compute video group IDs.
   EXPECT_CALL(*audio_manager_, MockGetAudioInputDeviceNames(_));
   EXPECT_CALL(media_devices_manager_client_,
-              InputDevicesChangedUI(MEDIA_DEVICE_TYPE_AUDIO_INPUT, _));
+              InputDevicesChangedUI(blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT, _));
   EXPECT_CALL(*video_capture_device_factory_, MockGetDeviceDescriptors());
   EXPECT_CALL(media_devices_manager_client_,
-              InputDevicesChangedUI(MEDIA_DEVICE_TYPE_VIDEO_INPUT, _));
+              InputDevicesChangedUI(blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT, _));
   // Configure fake devices with video formats different from the fallback
   // formats to make sure that expected capabilities are what devices actually
   // report.
@@ -821,7 +827,7 @@
       fake_capture_device_settings);
 
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
   base::RunLoop run_loop;
   media_devices_manager_->EnumerateDevices(
       -1, -1, devices_to_enumerate, true,
@@ -832,7 +838,7 @@
 }
 
 TEST_F(MediaDevicesManagerTest, GuessVideoGroupID) {
-  MediaDeviceInfoArray audio_devices = {
+  blink::WebMediaDeviceInfoArray audio_devices = {
       {media::AudioDeviceDescription::kDefaultDeviceId,
        "Default - Unique USB Mic (1234:5678)", "group_1"},
       {media::AudioDeviceDescription::kCommunicationsDeviceId,
@@ -860,33 +866,33 @@
        "communications - Unique USB Mic (1234:5678)", "group_1"},
   };
 
-  MediaDeviceInfo logitech_video("logitech_video",
-                                 "Logitech Webcam C930e (046d:0843)", "");
-  MediaDeviceInfo hd_pro_video("hd_pro_video", "HD Pro Webcam C920 (046d:082d)",
-                               "");
-  MediaDeviceInfo lifecam_video(
+  blink::WebMediaDeviceInfo logitech_video(
+      "logitech_video", "Logitech Webcam C930e (046d:0843)", "");
+  blink::WebMediaDeviceInfo hd_pro_video("hd_pro_video",
+                                         "HD Pro Webcam C920 (046d:082d)", "");
+  blink::WebMediaDeviceInfo lifecam_video(
       "lifecam_video", "Microsoft® LifeCam Cinema(TM) (045e:075d)", "");
-  MediaDeviceInfo repeated_webcam1_video("repeated_webcam_1", "Repeated webcam",
-                                         "");
-  MediaDeviceInfo repeated_webcam2_video("repeated_webcam_2", "Repeated webcam",
-                                         "");
-  MediaDeviceInfo dual_mic_video("dual_mic_video",
-                                 "Dual-mic webcam device (1111:1111)", "");
-  MediaDeviceInfo webcam_only_video("webcam_only_video", "Webcam-only device",
-                                    "");
-  MediaDeviceInfo repeated_dual_mic1_video(
+  blink::WebMediaDeviceInfo repeated_webcam1_video("repeated_webcam_1",
+                                                   "Repeated webcam", "");
+  blink::WebMediaDeviceInfo repeated_webcam2_video("repeated_webcam_2",
+                                                   "Repeated webcam", "");
+  blink::WebMediaDeviceInfo dual_mic_video(
+      "dual_mic_video", "Dual-mic webcam device (1111:1111)", "");
+  blink::WebMediaDeviceInfo webcam_only_video("webcam_only_video",
+                                              "Webcam-only device", "");
+  blink::WebMediaDeviceInfo repeated_dual_mic1_video(
       "repeated_dual_mic1_video", "Repeated dual-mic webcam device", "");
-  MediaDeviceInfo repeated_dual_mic2_video(
+  blink::WebMediaDeviceInfo repeated_dual_mic2_video(
       "repeated_dual_mic2_video", "Repeated dual-mic webcam device", "");
-  MediaDeviceInfo short_label_video("short_label_video", " ()", "");
-  MediaDeviceInfo unique_usb_video("unique_usb_video",
-                                   "Unique USB webcam (1234:5678)", "");
-  MediaDeviceInfo another_unique_usb_video(
+  blink::WebMediaDeviceInfo short_label_video("short_label_video", " ()", "");
+  blink::WebMediaDeviceInfo unique_usb_video(
+      "unique_usb_video", "Unique USB webcam (1234:5678)", "");
+  blink::WebMediaDeviceInfo another_unique_usb_video(
       "another_unique_usb_video", "Another Unique USB webcam (5678:9abc)", "");
-  MediaDeviceInfo repeated_usb1_video("repeated_usb1_video",
-                                      "Repeated USB webcam (8765:4321)", "");
-  MediaDeviceInfo repeated_usb2_video("repeated_usb2_video",
-                                      "Repeated USB webcam (8765:4321)", "");
+  blink::WebMediaDeviceInfo repeated_usb1_video(
+      "repeated_usb1_video", "Repeated USB webcam (8765:4321)", "");
+  blink::WebMediaDeviceInfo repeated_usb2_video(
+      "repeated_usb2_video", "Repeated USB webcam (8765:4321)", "");
 
   EXPECT_EQ(GuessVideoGroupID(audio_devices, logitech_video), "group_1");
   EXPECT_EQ(GuessVideoGroupID(audio_devices, hd_pro_video), "group_2");
diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
index bc7e464..967b1fe 100644
--- a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
@@ -70,7 +70,7 @@
 void AudioInputDevicesEnumerated(base::Closure quit_closure,
                                  media::AudioDeviceDescriptions* out,
                                  const MediaDeviceEnumeration& enumeration) {
-  for (const auto& info : enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT]) {
+  for (const auto& info : enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT]) {
     out->emplace_back(info.label, info.device_id, info.group_id);
   }
   std::move(quit_closure).Run();
@@ -304,7 +304,7 @@
 
     base::RunLoop run_loop;
     MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-    devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
+    devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] = true;
     media_stream_manager_->media_devices_manager()->EnumerateDevices(
         devices_to_enumerate,
         base::BindOnce(&AudioInputDevicesEnumerated, run_loop.QuitClosure(),
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index 440ddf2..59b22af 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -146,7 +146,7 @@
 bool GetDeviceIDFromHMAC(const std::string& salt,
                          const url::Origin& security_origin,
                          const std::string& hmac_device_id,
-                         const MediaDeviceInfoArray& devices,
+                         const blink::WebMediaDeviceInfoArray& devices,
                          std::string* device_id) {
   // The source_id can be empty if the constraint is set but empty.
   if (hmac_device_id.empty())
@@ -162,11 +162,11 @@
   return false;
 }
 
-MediaStreamType ConvertToMediaStreamType(MediaDeviceType type) {
+MediaStreamType ConvertToMediaStreamType(blink::MediaDeviceType type) {
   switch (type) {
-    case MEDIA_DEVICE_TYPE_AUDIO_INPUT:
+    case blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT:
       return blink::MEDIA_DEVICE_AUDIO_CAPTURE;
-    case MEDIA_DEVICE_TYPE_VIDEO_INPUT:
+    case blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT:
       return blink::MEDIA_DEVICE_VIDEO_CAPTURE;
     default:
       NOTREACHED();
@@ -175,17 +175,17 @@
   return blink::MEDIA_NO_SERVICE;
 }
 
-MediaDeviceType ConvertToMediaDeviceType(MediaStreamType stream_type) {
+blink::MediaDeviceType ConvertToMediaDeviceType(MediaStreamType stream_type) {
   switch (stream_type) {
     case blink::MEDIA_DEVICE_AUDIO_CAPTURE:
-      return MEDIA_DEVICE_TYPE_AUDIO_INPUT;
+      return blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT;
     case blink::MEDIA_DEVICE_VIDEO_CAPTURE:
-      return MEDIA_DEVICE_TYPE_VIDEO_INPUT;
+      return blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT;
     default:
       NOTREACHED();
   }
 
-  return NUM_MEDIA_DEVICE_TYPES;
+  return blink::NUM_MEDIA_DEVICE_TYPES;
 }
 
 void SendVideoCaptureLogMessage(const std::string& message) {
@@ -922,7 +922,7 @@
 
   // TODO(guidou): Change to use MediaDevicesManager::EnumerateDevices.
   // See http://crbug.com/648155.
-  MediaDeviceInfoArray cached_devices =
+  blink::WebMediaDeviceInfoArray cached_devices =
       media_devices_manager_->GetCachedDeviceInfo(
           ConvertToMediaDeviceType(stream_type));
   return GetDeviceIDFromHMAC(salt, security_origin, source_id, cached_devices,
@@ -935,11 +935,11 @@
 }
 
 void MediaStreamManager::StopRemovedDevice(
-    MediaDeviceType type,
-    const MediaDeviceInfo& media_device_info) {
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfo& media_device_info) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  DCHECK(type == MEDIA_DEVICE_TYPE_AUDIO_INPUT ||
-         type == MEDIA_DEVICE_TYPE_VIDEO_INPUT);
+  DCHECK(type == blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT ||
+         type == blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT);
 
   MediaStreamType stream_type = ConvertToMediaStreamType(type);
   std::vector<int> session_ids;
@@ -972,7 +972,7 @@
 bool MediaStreamManager::PickDeviceId(
     const MediaDeviceSaltAndOrigin& salt_and_origin,
     const TrackControls& controls,
-    const MediaDeviceInfoArray& devices,
+    const blink::WebMediaDeviceInfoArray& devices,
     std::string* device_id) const {
   if (controls.device_id.empty())
     return true;
@@ -989,7 +989,7 @@
 bool MediaStreamManager::GetRequestedDeviceCaptureId(
     const DeviceRequest* request,
     MediaStreamType type,
-    const MediaDeviceInfoArray& devices,
+    const blink::WebMediaDeviceInfoArray& devices,
     std::string* device_id) const {
   if (type == blink::MEDIA_DEVICE_AUDIO_CAPTURE) {
     return PickDeviceId(request->salt_and_origin, request->controls.audio,
@@ -1039,8 +1039,10 @@
   // UI thread, after the IO thread has been stopped.
   DCHECK(request_audio_input || request_video_input);
   MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_AUDIO_INPUT] = request_audio_input;
-  devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = request_video_input;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] =
+      request_audio_input;
+  devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] =
+      request_video_input;
   media_devices_manager_->EnumerateDevices(
       devices_to_enumerate,
       base::BindOnce(&MediaStreamManager::DevicesEnumerated,
@@ -1153,9 +1155,11 @@
           label));
     } else {
       MediaStreamDevices audio_devices = ConvertToMediaStreamDevices(
-          request->audio_type(), enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT]);
+          request->audio_type(),
+          enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT]);
       MediaStreamDevices video_devices = ConvertToMediaStreamDevices(
-          request->video_type(), enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT]);
+          request->video_type(),
+          enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT]);
       devices.reserve(audio_devices.size() + video_devices.size());
       devices.insert(devices.end(), audio_devices.begin(), audio_devices.end());
       devices.insert(devices.end(), video_devices.begin(), video_devices.end());
@@ -1261,17 +1265,19 @@
           request->video_type() == blink::MEDIA_NO_SERVICE));
   std::string audio_device_id;
   if (request->controls.audio.requested &&
-      !GetRequestedDeviceCaptureId(request, request->audio_type(),
-                                   enumeration[MEDIA_DEVICE_TYPE_AUDIO_INPUT],
-                                   &audio_device_id)) {
+      !GetRequestedDeviceCaptureId(
+          request, request->audio_type(),
+          enumeration[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT],
+          &audio_device_id)) {
     return false;
   }
 
   std::string video_device_id;
   if (request->controls.video.requested &&
-      !GetRequestedDeviceCaptureId(request, request->video_type(),
-                                   enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT],
-                                   &video_device_id)) {
+      !GetRequestedDeviceCaptureId(
+          request, request->video_type(),
+          enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT],
+          &video_device_id)) {
     return false;
   }
   request->CreateUIRequest(audio_device_id, video_device_id);
@@ -1951,8 +1957,8 @@
 }
 
 void MediaStreamManager::NotifyDevicesChanged(
-    MediaDeviceType device_type,
-    const MediaDeviceInfoArray& devices) {
+    blink::MediaDeviceType device_type,
+    const blink::WebMediaDeviceInfoArray& devices) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   MediaObserver* media_observer =
       GetContentClient()->browser()->GetMediaObserver();
@@ -2126,7 +2132,7 @@
 
 MediaStreamDevices MediaStreamManager::ConvertToMediaStreamDevices(
     MediaStreamType stream_type,
-    const MediaDeviceInfoArray& device_infos) {
+    const blink::WebMediaDeviceInfoArray& device_infos) {
   MediaStreamDevices devices;
   for (const auto& info : device_infos) {
     devices.emplace_back(stream_type, info.device_id, info.label,
diff --git a/content/browser/renderer_host/media/media_stream_manager.h b/content/browser/renderer_host/media/media_stream_manager.h
index 3a3d2fe..970b690 100644
--- a/content/browser/renderer_host/media/media_stream_manager.h
+++ b/content/browser/renderer_host/media/media_stream_manager.h
@@ -47,11 +47,11 @@
 #include "content/browser/renderer_host/media/media_devices_manager.h"
 #include "content/browser/renderer_host/media/media_stream_provider.h"
 #include "content/common/content_export.h"
-#include "content/common/media/media_devices.h"
 #include "content/public/browser/desktop_media_id.h"
 #include "content/public/browser/media_request_state.h"
 #include "content/public/browser/media_stream_request.h"
 #include "media/base/video_facing.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
 #include "third_party/blink/public/common/mediastream/media_stream_controls.h"
 #include "third_party/blink/public/common/mediastream/media_stream_request.h"
 
@@ -314,14 +314,14 @@
 
   // Helper for sending up-to-date device lists to media observer when a
   // capture device is plugged in or unplugged.
-  void NotifyDevicesChanged(MediaDeviceType stream_type,
-                            const MediaDeviceInfoArray& devices);
+  void NotifyDevicesChanged(blink::MediaDeviceType stream_type,
+                            const blink::WebMediaDeviceInfoArray& devices);
 
   // This method is called when an audio or video device is removed. It makes
   // sure all MediaStreams that use a removed device are stopped and that the
   // render process is notified. Must be called on the IO thread.
-  void StopRemovedDevice(MediaDeviceType type,
-                         const MediaDeviceInfo& media_device_info);
+  void StopRemovedDevice(blink::MediaDeviceType type,
+                         const blink::WebMediaDeviceInfo& media_device_info);
 
   void SetGenerateStreamCallbackForTesting(
       GenerateStreamTestCallback test_callback);
@@ -451,15 +451,16 @@
   // Otherwise, if no valid device is found, device_id is unchanged.
   bool PickDeviceId(const MediaDeviceSaltAndOrigin& salt_and_origin,
                     const blink::TrackControls& controls,
-                    const MediaDeviceInfoArray& devices,
+                    const blink::WebMediaDeviceInfoArray& devices,
                     std::string* device_id) const;
 
   // Finds the requested device id from request. The requested device type
   // must be MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE.
-  bool GetRequestedDeviceCaptureId(const DeviceRequest* request,
-                                   blink::MediaStreamType type,
-                                   const MediaDeviceInfoArray& devices,
-                                   std::string* device_id) const;
+  bool GetRequestedDeviceCaptureId(
+      const DeviceRequest* request,
+      blink::MediaStreamType type,
+      const blink::WebMediaDeviceInfoArray& devices,
+      std::string* device_id) const;
 
   void TranslateDeviceIdToSourceId(DeviceRequest* request,
                                    blink::MediaStreamDevice* device);
@@ -487,7 +488,7 @@
   // |video_capture_manager_| to set the MediaStreamDevice fields.
   blink::MediaStreamDevices ConvertToMediaStreamDevices(
       blink::MediaStreamType stream_type,
-      const MediaDeviceInfoArray& device_infos);
+      const blink::WebMediaDeviceInfoArray& device_infos);
 
   media::AudioSystem* const audio_system_;  // not owned
   scoped_refptr<AudioInputDeviceManager> audio_input_device_manager_;
diff --git a/content/browser/renderer_host/media/old_render_frame_audio_input_stream_factory.cc b/content/browser/renderer_host/media/old_render_frame_audio_input_stream_factory.cc
index a84a595..fc1511a 100644
--- a/content/browser/renderer_host/media/old_render_frame_audio_input_stream_factory.cc
+++ b/content/browser/renderer_host/media/old_render_frame_audio_input_stream_factory.cc
@@ -31,7 +31,8 @@
   // Check permissions for everything but the default device
   if (!media::AudioDeviceDescription::IsDefaultDevice(output_device_id) &&
       !MediaDevicesPermissionChecker().CheckPermissionOnUIThread(
-          MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, render_process_id, render_frame_id)) {
+          blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, render_process_id,
+          render_frame_id)) {
     // If we're not allowed to use the device, don't call |cb|.
     return;
   }
@@ -47,7 +48,7 @@
     const MediaDeviceSaltAndOrigin& salt_and_origin) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   MediaDevicesManager::BoolDeviceTypes device_types;
-  device_types[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  device_types[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   media_devices_manager->EnumerateDevices(device_types,
                                           base::BindOnce(cb, salt_and_origin));
 }
@@ -215,7 +216,8 @@
     const MediaDeviceEnumeration& device_array) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   std::string raw_output_device_id;
-  for (const auto& device_info : device_array[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]) {
+  for (const auto& device_info :
+       device_array[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]) {
     if (MediaStreamManager::DoesMediaDeviceIDMatchHMAC(
             salt_and_origin.device_id_salt, salt_and_origin.origin,
             output_device_id, device_info.device_id)) {
diff --git a/content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc b/content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc
index ccd9404..b9690c7 100644
--- a/content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc
+++ b/content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc
@@ -61,7 +61,7 @@
                             MediaDevicesManager::EnumerationCallback cb) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   MediaDevicesManager::BoolDeviceTypes device_types;
-  device_types[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
+  device_types[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT] = true;
   media_stream_manager->media_devices_manager()->EnumerateDevices(
       device_types, std::move(cb));
 }
@@ -71,7 +71,8 @@
                        base::RepeatingCallback<void(const std::string&)> cb,
                        const MediaDeviceEnumeration& device_array) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  for (const auto& device_info : device_array[MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]) {
+  for (const auto& device_info :
+       device_array[blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT]) {
     if (MediaStreamManager::DoesMediaDeviceIDMatchHMAC(
             salt_and_origin.device_id_salt, salt_and_origin.origin, device_id,
             device_info.device_id)) {
@@ -89,7 +90,7 @@
                             bool has_access)> cb) {
   auto salt_and_origin = GetMediaDeviceSaltAndOrigin(process_id, frame_id);
   bool access = MediaDevicesPermissionChecker().CheckPermissionOnUIThread(
-      MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, process_id, frame_id);
+      blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, process_id, frame_id);
   base::PostTaskWithTraits(
       FROM_HERE, {BrowserThread::IO},
       base::BindOnce(std::move(cb), std::move(salt_and_origin), access));
diff --git a/content/browser/renderer_host/media/video_capture_unittest.cc b/content/browser/renderer_host/media/video_capture_unittest.cc
index bed252e..5af6f4a 100644
--- a/content/browser/renderer_host/media/video_capture_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_unittest.cc
@@ -22,7 +22,6 @@
 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h"
 #include "content/browser/renderer_host/media/video_capture_host.h"
 #include "content/browser/renderer_host/media/video_capture_manager.h"
-#include "content/common/media/media_devices.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/test/test_browser_context.h"
 #include "content/public/test/test_browser_thread_bundle.h"
@@ -36,6 +35,7 @@
 #include "net/url_request/url_request_context.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
 
 using ::testing::_;
 using ::testing::AnyNumber;
@@ -54,12 +54,13 @@
 void VideoInputDevicesEnumerated(base::Closure quit_closure,
                                  const std::string& salt,
                                  const url::Origin& security_origin,
-                                 MediaDeviceInfoArray* out,
+                                 blink::WebMediaDeviceInfoArray* out,
                                  const MediaDeviceEnumeration& enumeration) {
-  for (const auto& info : enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT]) {
+  for (const auto& info : enumeration[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT]) {
     std::string device_id = MediaStreamManager::GetHMACForMediaDeviceID(
         salt, security_origin, info.device_id);
-    out->push_back(MediaDeviceInfo(device_id, info.label, std::string()));
+    out->push_back(
+        blink::WebMediaDeviceInfo(device_id, info.label, std::string()));
   }
   std::move(quit_closure).Run();
 }
@@ -136,11 +137,11 @@
     ASSERT_TRUE(opened_device_label_.empty());
 
     // Enumerate video devices.
-    MediaDeviceInfoArray video_devices;
+    blink::WebMediaDeviceInfoArray video_devices;
     {
       base::RunLoop run_loop;
       MediaDevicesManager::BoolDeviceTypes devices_to_enumerate;
-      devices_to_enumerate[MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
+      devices_to_enumerate[blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT] = true;
       media_stream_manager_->media_devices_manager()->EnumerateDevices(
           devices_to_enumerate,
           base::BindOnce(&VideoInputDevicesEnumerated, run_loop.QuitClosure(),
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
index f13acba..43c30e3 100644
--- a/content/common/BUILD.gn
+++ b/content/common/BUILD.gn
@@ -181,8 +181,6 @@
     "mac/font_loader.mm",
     "media/aec_dump_messages.h",
     "media/cdm_info.cc",
-    "media/media_devices.cc",
-    "media/media_devices.h",
     "media/media_player_delegate_messages.h",
     "media/media_player_messages_android.h",
     "media/peer_connection_tracker_messages.h",
diff --git a/content/common/media/media_devices.cc b/content/common/media/media_devices.cc
deleted file mode 100644
index b42bf40..0000000
--- a/content/common/media/media_devices.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/common/media/media_devices.h"
-#include "media/capture/video/video_capture_device_descriptor.h"
-
-namespace content {
-
-MediaDeviceInfo::MediaDeviceInfo()
-    : video_facing(media::VideoFacingMode::MEDIA_VIDEO_FACING_NONE) {}
-
-MediaDeviceInfo::MediaDeviceInfo(const MediaDeviceInfo& other) = default;
-
-MediaDeviceInfo::MediaDeviceInfo(MediaDeviceInfo&& other) = default;
-
-MediaDeviceInfo::MediaDeviceInfo(const std::string& device_id,
-                                 const std::string& label,
-                                 const std::string& group_id,
-                                 media::VideoFacingMode video_facing)
-    : device_id(device_id),
-      label(label),
-      group_id(group_id),
-      video_facing(video_facing) {}
-
-MediaDeviceInfo::MediaDeviceInfo(
-    const media::VideoCaptureDeviceDescriptor& descriptor)
-    : device_id(descriptor.device_id),
-      label(descriptor.GetNameAndModel()),
-      video_facing(descriptor.facing) {}
-
-MediaDeviceInfo::~MediaDeviceInfo() = default;
-
-MediaDeviceInfo& MediaDeviceInfo::operator=(const MediaDeviceInfo& other) =
-    default;
-
-MediaDeviceInfo& MediaDeviceInfo::operator=(MediaDeviceInfo&& other) = default;
-
-bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second) {
-  // Do not use the |group_id| and |video_facing| fields for equality comparison
-  // since they are currently not fully supported by the video-capture layer.
-  // The modification of those fields by heuristics in upper layers does not
-  // result in a different device.
-  return first.device_id == second.device_id && first.label == second.label;
-}
-
-}  // namespace content
diff --git a/content/common/media/media_devices.h b/content/common/media/media_devices.h
deleted file mode 100644
index 6aa4b9f..0000000
--- a/content/common/media/media_devices.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_
-#define CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_
-
-#include <string>
-#include <vector>
-
-#include "content/common/content_export.h"
-#include "media/base/video_facing.h"
-
-namespace media {
-struct VideoCaptureDeviceDescriptor;
-}  // namespace media
-
-namespace content {
-
-enum MediaDeviceType {
-  MEDIA_DEVICE_TYPE_AUDIO_INPUT,
-  MEDIA_DEVICE_TYPE_VIDEO_INPUT,
-  MEDIA_DEVICE_TYPE_AUDIO_OUTPUT,
-  NUM_MEDIA_DEVICE_TYPES,
-};
-
-struct CONTENT_EXPORT MediaDeviceInfo {
-  MediaDeviceInfo();
-  MediaDeviceInfo(const MediaDeviceInfo& other);
-  MediaDeviceInfo(MediaDeviceInfo&& other);
-  MediaDeviceInfo(
-      const std::string& device_id,
-      const std::string& label,
-      const std::string& group_id,
-      media::VideoFacingMode video_facing = media::MEDIA_VIDEO_FACING_NONE);
-  explicit MediaDeviceInfo(
-      const media::VideoCaptureDeviceDescriptor& descriptor);
-  ~MediaDeviceInfo();
-  MediaDeviceInfo& operator=(const MediaDeviceInfo& other);
-  MediaDeviceInfo& operator=(MediaDeviceInfo&& other);
-
-  std::string device_id;
-  std::string label;
-  std::string group_id;
-  media::VideoFacingMode video_facing;
-};
-
-using MediaDeviceInfoArray = std::vector<MediaDeviceInfo>;
-
-bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second);
-
-inline bool IsValidMediaDeviceType(MediaDeviceType type) {
-  return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES;
-}
-
-}  // namespace content
-
-#endif  // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_H_
diff --git a/content/common/media/media_devices.typemap b/content/common/media/media_devices.typemap
deleted file mode 100644
index eaf7eb5..0000000
--- a/content/common/media/media_devices.typemap
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-mojom = "//third_party/blink/public/platform/modules/mediastream/media_devices.mojom"
-public_headers = [ "//content/common/media/media_devices.h" ]
-traits_headers = [ "//content/common/media/media_devices_mojom_traits.h" ]
-sources = [
-  "//content/common/media/media_devices_mojom_traits.cc",
-]
-type_mappings = [
-  "blink.mojom.MediaDeviceType=content::MediaDeviceType",
-  "blink.mojom.MediaDeviceInfo=content::MediaDeviceInfo",
-  "blink.mojom.FacingMode=media::VideoFacingMode",
-]
diff --git a/content/common/media/media_devices_mojom_traits.h b/content/common/media/media_devices_mojom_traits.h
deleted file mode 100644
index 8274b11..0000000
--- a/content/common/media/media_devices_mojom_traits.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_COMMON_MEDIA_MEDIA_DEVICES_MOJOM_TRAITS_H_
-#define CONTENT_COMMON_MEDIA_MEDIA_DEVICES_MOJOM_TRAITS_H_
-
-#include "content/common/media/media_devices.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
-
-namespace mojo {
-
-template <>
-struct EnumTraits<blink::mojom::MediaDeviceType, content::MediaDeviceType> {
-  static blink::mojom::MediaDeviceType ToMojom(content::MediaDeviceType type);
-
-  static bool FromMojom(blink::mojom::MediaDeviceType input,
-                        content::MediaDeviceType* out);
-};
-
-template <>
-struct EnumTraits<blink::mojom::FacingMode, media::VideoFacingMode> {
-  static blink::mojom::FacingMode ToMojom(media::VideoFacingMode facing_mode);
-
-  static bool FromMojom(blink::mojom::FacingMode input,
-                        media::VideoFacingMode* out);
-};
-
-template <>
-struct StructTraits<blink::mojom::MediaDeviceInfoDataView,
-                    content::MediaDeviceInfo> {
-  static const std::string& device_id(const content::MediaDeviceInfo& info) {
-    return info.device_id;
-  }
-
-  static const std::string& label(const content::MediaDeviceInfo& info) {
-    return info.label;
-  }
-
-  static const std::string& group_id(const content::MediaDeviceInfo& info) {
-    return info.group_id;
-  }
-
-  static bool Read(blink::mojom::MediaDeviceInfoDataView input,
-                   content::MediaDeviceInfo* out);
-};
-
-}  // namespace mojo
-
-#endif  // CONTENT_COMMON_MEDIA_MEDIA_DEVICES_MOJOM_TRAITS_H_
diff --git a/content/common/typemaps.gni b/content/common/typemaps.gni
index 31b5ea2..5476d2d 100644
--- a/content/common/typemaps.gni
+++ b/content/common/typemaps.gni
@@ -6,7 +6,6 @@
   "//content/common/frame.typemap",
   "//content/common/frame_messages.typemap",
   "//content/common/input/synchronous_compositor.typemap",
-  "//content/common/media/media_devices.typemap",
   "//content/common/native_types.typemap",
   "//content/common/native_types_mac.typemap",
   "//content/common/navigation_params.typemap",
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index 9ae2806..db697be 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -673,7 +673,6 @@
     "//storage/common",
     "//third_party/blink/public:blink",
     "//third_party/blink/public:buildflags",
-    "//third_party/blink/public:media_devices_mojo_bindings",
     "//third_party/blink/public:mojo_bindings",
     "//third_party/blink/public/common",
     "//third_party/boringssl",
diff --git a/content/renderer/media/stream/apply_constraints_processor.h b/content/renderer/media/stream/apply_constraints_processor.h
index a7182c2..943989f 100644
--- a/content/renderer/media/stream/apply_constraints_processor.h
+++ b/content/renderer/media/stream/apply_constraints_processor.h
@@ -13,7 +13,7 @@
 #include "content/common/content_export.h"
 #include "content/renderer/media/stream/media_stream_constraints_util.h"
 #include "media/capture/video_capture_types.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 #include "third_party/blink/public/web/web_apply_constraints_request.h"
 
 namespace blink {
diff --git a/content/renderer/media/stream/media_stream_constraints_util.h b/content/renderer/media/stream/media_stream_constraints_util.h
index 15434db..975baa3 100644
--- a/content/renderer/media/stream/media_stream_constraints_util.h
+++ b/content/renderer/media/stream/media_stream_constraints_util.h
@@ -14,7 +14,7 @@
 #include "content/renderer/media/stream/video_track_adapter.h"
 #include "media/base/video_facing.h"
 #include "media/capture/video_capture_types.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 #include "third_party/blink/public/platform/web_media_constraints.h"
 #include "third_party/blink/public/platform/web_media_stream_source.h"
 
diff --git a/content/renderer/media/stream/media_stream_constraints_util_audio.h b/content/renderer/media/stream/media_stream_constraints_util_audio.h
index c7d7fe9..b9dbe85 100644
--- a/content/renderer/media/stream/media_stream_constraints_util_audio.h
+++ b/content/renderer/media/stream/media_stream_constraints_util_audio.h
@@ -10,7 +10,7 @@
 
 #include "content/common/content_export.h"
 #include "content/renderer/media/stream/media_stream_constraints_util.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 
 namespace blink {
 class WebMediaConstraints;
diff --git a/content/renderer/media/stream/media_stream_constraints_util_audio_unittest.cc b/content/renderer/media/stream/media_stream_constraints_util_audio_unittest.cc
index eb1d5aa..a301dfa 100644
--- a/content/renderer/media/stream/media_stream_constraints_util_audio_unittest.cc
+++ b/content/renderer/media/stream/media_stream_constraints_util_audio_unittest.cc
@@ -20,7 +20,6 @@
 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.h"
 #include "media/base/audio_parameters.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
 #include "third_party/blink/public/platform/web_media_constraints.h"
 #include "third_party/blink/public/platform/web_string.h"
 
diff --git a/content/renderer/media/stream/media_stream_constraints_util_video_device.h b/content/renderer/media/stream/media_stream_constraints_util_video_device.h
index 25b611f..484ffc6 100644
--- a/content/renderer/media/stream/media_stream_constraints_util_video_device.h
+++ b/content/renderer/media/stream/media_stream_constraints_util_video_device.h
@@ -12,7 +12,7 @@
 #include "content/common/content_export.h"
 #include "content/renderer/media/stream/media_stream_constraints_util.h"
 #include "media/capture/video_capture_types.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 
 namespace blink {
 class WebString;
diff --git a/content/renderer/media/stream/user_media_client_impl.h b/content/renderer/media/stream/user_media_client_impl.h
index 778eeea..b325c56 100644
--- a/content/renderer/media/stream/user_media_client_impl.h
+++ b/content/renderer/media/stream/user_media_client_impl.h
@@ -14,10 +14,10 @@
 #include "base/sequence_checker.h"
 #include "base/single_thread_task_runner.h"
 #include "content/common/content_export.h"
-#include "content/common/media/media_devices.h"
 #include "content/public/renderer/render_frame_observer.h"
 #include "content/renderer/media/stream/user_media_processor.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 #include "third_party/blink/public/web/web_apply_constraints_request.h"
 #include "third_party/blink/public/web/web_user_media_client.h"
 #include "third_party/blink/public/web/web_user_media_request.h"
diff --git a/content/renderer/media/stream/user_media_client_impl_unittest.cc b/content/renderer/media/stream/user_media_client_impl_unittest.cc
index 05db904..ea6f238 100644
--- a/content/renderer/media/stream/user_media_client_impl_unittest.cc
+++ b/content/renderer/media/stream/user_media_client_impl_unittest.cc
@@ -15,7 +15,6 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/scoped_task_environment.h"
 #include "content/child/child_process.h"
-#include "content/common/media/media_devices.h"
 #include "content/renderer/media/stream/media_stream_audio_processor_options.h"
 #include "content/renderer/media/stream/media_stream_audio_source.h"
 #include "content/renderer/media/stream/media_stream_audio_track.h"
@@ -30,6 +29,7 @@
 #include "media/audio/audio_device_description.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
 #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
 #include "third_party/blink/public/platform/web_media_stream.h"
 #include "third_party/blink/public/platform/web_media_stream_source.h"
diff --git a/content/renderer/media/stream/user_media_processor.h b/content/renderer/media/stream/user_media_processor.h
index 39b1961..4b1cd6c 100644
--- a/content/renderer/media/stream/user_media_processor.h
+++ b/content/renderer/media/stream/user_media_processor.h
@@ -18,8 +18,8 @@
 #include "content/common/content_export.h"
 #include "content/renderer/media/stream/media_stream_dispatcher_eventhandler.h"
 #include "content/renderer/media/stream/media_stream_source.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 #include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
 #include "third_party/blink/public/platform/web_vector.h"
 #include "third_party/blink/public/web/web_user_media_request.h"
 
diff --git a/content/renderer/pepper/pepper_media_device_manager.cc b/content/renderer/pepper/pepper_media_device_manager.cc
index d8d34c9..fb20b9c 100644
--- a/content/renderer/pepper/pepper_media_device_manager.cc
+++ b/content/renderer/pepper/pepper_media_device_manager.cc
@@ -29,13 +29,13 @@
     "secure origin, such as HTTPS. See https://goo.gl/rStTGz for more "
     "details.";
 
-PP_DeviceType_Dev FromMediaDeviceType(MediaDeviceType type) {
+PP_DeviceType_Dev FromMediaDeviceType(blink::MediaDeviceType type) {
   switch (type) {
-    case MEDIA_DEVICE_TYPE_AUDIO_INPUT:
+    case blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT:
       return PP_DEVICETYPE_DEV_AUDIOCAPTURE;
-    case MEDIA_DEVICE_TYPE_VIDEO_INPUT:
+    case blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT:
       return PP_DEVICETYPE_DEV_VIDEOCAPTURE;
-    case MEDIA_DEVICE_TYPE_AUDIO_OUTPUT:
+    case blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT:
       return PP_DEVICETYPE_DEV_AUDIOOUTPUT;
     default:
       NOTREACHED();
@@ -43,22 +43,23 @@
   }
 }
 
-MediaDeviceType ToMediaDeviceType(PP_DeviceType_Dev type) {
+blink::MediaDeviceType ToMediaDeviceType(PP_DeviceType_Dev type) {
   switch (type) {
     case PP_DEVICETYPE_DEV_AUDIOCAPTURE:
-      return MEDIA_DEVICE_TYPE_AUDIO_INPUT;
+      return blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT;
     case PP_DEVICETYPE_DEV_VIDEOCAPTURE:
-      return MEDIA_DEVICE_TYPE_VIDEO_INPUT;
+      return blink::MEDIA_DEVICE_TYPE_VIDEO_INPUT;
     case PP_DEVICETYPE_DEV_AUDIOOUTPUT:
-      return MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
+      return blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
     default:
       NOTREACHED();
-      return MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
+      return blink::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
   }
 }
 
-ppapi::DeviceRefData FromMediaDeviceInfo(MediaDeviceType type,
-                                         const MediaDeviceInfo& info) {
+ppapi::DeviceRefData FromMediaDeviceInfo(
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfo& info) {
   ppapi::DeviceRefData data;
   data.id = info.device_id;
   // Some Flash content can't handle an empty string, so stick a space in to
@@ -69,8 +70,8 @@
 }
 
 std::vector<ppapi::DeviceRefData> FromMediaDeviceInfoArray(
-    MediaDeviceType type,
-    const MediaDeviceInfoArray& device_infos) {
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfoArray& device_infos) {
   std::vector<ppapi::DeviceRefData> devices;
   devices.reserve(device_infos.size());
   for (const auto& device_info : device_infos)
@@ -219,8 +220,8 @@
 }
 
 void PepperMediaDeviceManager::OnDevicesChanged(
-    MediaDeviceType type,
-    const MediaDeviceInfoArray& device_infos) {
+    blink::MediaDeviceType type,
+    const blink::WebMediaDeviceInfoArray& device_infos) {
   std::vector<ppapi::DeviceRefData> devices =
       FromMediaDeviceInfoArray(type, device_infos);
   SubscriptionList& subscriptions = device_change_subscriptions_[type];
@@ -250,8 +251,8 @@
 
 void PepperMediaDeviceManager::DevicesEnumerated(
     const DevicesCallback& client_callback,
-    MediaDeviceType type,
-    const std::vector<MediaDeviceInfoArray>& enumeration,
+    blink::MediaDeviceType type,
+    const std::vector<blink::WebMediaDeviceInfoArray>& enumeration,
     std::vector<blink::mojom::VideoInputDeviceCapabilitiesPtr>
         video_input_capabilities) {
   client_callback.Run(FromMediaDeviceInfoArray(type, enumeration[type]));
diff --git a/content/renderer/pepper/pepper_media_device_manager.h b/content/renderer/pepper/pepper_media_device_manager.h
index dce0cef..0d8f2f3 100644
--- a/content/renderer/pepper/pepper_media_device_manager.h
+++ b/content/renderer/pepper/pepper_media_device_manager.h
@@ -12,14 +12,14 @@
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "content/common/media/media_devices.h"
 #include "content/public/renderer/render_frame_observer.h"
 #include "content/public/renderer/render_frame_observer_tracker.h"
 #include "content/renderer/pepper/pepper_device_enumeration_host_helper.h"
 #include "mojo/public/cpp/bindings/binding_set.h"
 #include "ppapi/c/pp_instance.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
 #include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom.h"
 
 namespace content {
 class MediaStreamDeviceObserver;
@@ -44,8 +44,9 @@
                              size_t subscription_id) override;
 
   // blink::mojom::MediaDevicesListener implementation.
-  void OnDevicesChanged(MediaDeviceType type,
-                        const MediaDeviceInfoArray& device_infos) override;
+  void OnDevicesChanged(
+      blink::MediaDeviceType type,
+      const blink::WebMediaDeviceInfoArray& device_infos) override;
 
   typedef base::Callback<void(int /* request_id */,
                               bool /* succeeded */,
@@ -88,8 +89,8 @@
 
   void DevicesEnumerated(
       const DevicesCallback& callback,
-      MediaDeviceType type,
-      const std::vector<MediaDeviceInfoArray>& enumeration,
+      blink::MediaDeviceType type,
+      const std::vector<blink::WebMediaDeviceInfoArray>& enumeration,
       std::vector<blink::mojom::VideoInputDeviceCapabilitiesPtr>
           video_input_capabilities);
 
@@ -105,7 +106,7 @@
 
   using Subscription = std::pair<size_t, DevicesCallback>;
   using SubscriptionList = std::vector<Subscription>;
-  SubscriptionList device_change_subscriptions_[NUM_MEDIA_DEVICE_TYPES];
+  SubscriptionList device_change_subscriptions_[blink::NUM_MEDIA_DEVICE_TYPES];
 
   blink::mojom::MediaStreamDispatcherHostPtr dispatcher_host_;
   blink::mojom::MediaDevicesDispatcherHostPtr media_devices_dispatcher_;
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 5d9e157..9aa400a 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -1698,7 +1698,6 @@
     "../common/inter_process_time_ticks_converter_unittest.cc",
     "../common/mac/attributed_string_coder_unittest.mm",
     "../common/manifest_util_unittest.cc",
-    "../common/media/media_devices_unittest.cc",
     "../common/mime_sniffing_throttle_unittest.cc",
     "../common/origin_util_unittest.cc",
     "../common/page_state_serialization_unittest.cc",
diff --git a/third_party/blink/common/BUILD.gn b/third_party/blink/common/BUILD.gn
index 78dc912..7cc97b3 100644
--- a/third_party/blink/common/BUILD.gn
+++ b/third_party/blink/common/BUILD.gn
@@ -42,6 +42,8 @@
     "loader/url_loader_factory_bundle_mojom_traits.cc",
     "manifest/manifest.cc",
     "manifest/manifest_icon_selector.cc",
+    "mediastream/media_devices.cc",
+    "mediastream/media_devices_mojom_traits.cc",
     "mediastream/media_stream_controls.cc",
     "mediastream/media_stream_mojom_traits.cc",
     "mediastream/media_stream_request.cc",
@@ -121,6 +123,7 @@
     "frame/user_activation_state_unittest.cc",
     "indexeddb/indexeddb_key_unittest.cc",
     "manifest/manifest_icon_selector_unittest.cc",
+    "mediastream/media_devices_unittest.cc",
     "mime_util/mime_util_unittest.cc",
     "notifications/notification_struct_traits_unittest.cc",
     "origin_policy/origin_policy_unittest.cc",
diff --git a/third_party/blink/common/mediastream/media_devices.cc b/third_party/blink/common/mediastream/media_devices.cc
new file mode 100644
index 0000000..3661b4b
--- /dev/null
+++ b/third_party/blink/common/mediastream/media_devices.cc
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "third_party/blink/public/common/mediastream/media_devices.h"
+#include "media/capture/video/video_capture_device_descriptor.h"
+
+namespace blink {
+
+WebMediaDeviceInfo::WebMediaDeviceInfo()
+    : video_facing(media::VideoFacingMode::MEDIA_VIDEO_FACING_NONE) {}
+
+WebMediaDeviceInfo::WebMediaDeviceInfo(const WebMediaDeviceInfo& other) =
+    default;
+
+WebMediaDeviceInfo::WebMediaDeviceInfo(WebMediaDeviceInfo&& other) = default;
+
+WebMediaDeviceInfo::WebMediaDeviceInfo(const std::string& device_id,
+                                       const std::string& label,
+                                       const std::string& group_id,
+                                       media::VideoFacingMode video_facing)
+    : device_id(device_id),
+      label(label),
+      group_id(group_id),
+      video_facing(video_facing) {}
+
+WebMediaDeviceInfo::WebMediaDeviceInfo(
+    const media::VideoCaptureDeviceDescriptor& descriptor)
+    : device_id(descriptor.device_id),
+      label(descriptor.GetNameAndModel()),
+      video_facing(descriptor.facing) {}
+
+WebMediaDeviceInfo::~WebMediaDeviceInfo() = default;
+
+WebMediaDeviceInfo& WebMediaDeviceInfo::operator=(
+    const WebMediaDeviceInfo& other) = default;
+
+WebMediaDeviceInfo& WebMediaDeviceInfo::operator=(WebMediaDeviceInfo&& other) =
+    default;
+
+bool operator==(const WebMediaDeviceInfo& first,
+                const WebMediaDeviceInfo& second) {
+  // Do not use the |group_id| and |video_facing| fields for equality comparison
+  // since they are currently not fully supported by the video-capture layer.
+  // The modification of those fields by heuristics in upper layers does not
+  // result in a different device.
+  return first.device_id == second.device_id && first.label == second.label;
+}
+
+}  // namespace blink
diff --git a/content/common/media/media_devices_mojom_traits.cc b/third_party/blink/common/mediastream/media_devices_mojom_traits.cc
similarity index 71%
rename from content/common/media/media_devices_mojom_traits.cc
rename to third_party/blink/common/mediastream/media_devices_mojom_traits.cc
index ff6b20531..494c0307 100644
--- a/content/common/media/media_devices_mojom_traits.cc
+++ b/third_party/blink/common/mediastream/media_devices_mojom_traits.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/common/media/media_devices_mojom_traits.h"
+#include "third_party/blink/public/common/mediastream/media_devices_mojom_traits.h"
 
 #include "base/logging.h"
 
@@ -10,14 +10,14 @@
 
 // static
 blink::mojom::MediaDeviceType
-EnumTraits<blink::mojom::MediaDeviceType, content::MediaDeviceType>::ToMojom(
-    content::MediaDeviceType type) {
+EnumTraits<blink::mojom::MediaDeviceType, blink::MediaDeviceType>::ToMojom(
+    blink::MediaDeviceType type) {
   switch (type) {
-    case content::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_INPUT:
+    case blink::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_INPUT:
       return blink::mojom::MediaDeviceType::MEDIA_AUDIO_INPUT;
-    case content::MediaDeviceType::MEDIA_DEVICE_TYPE_VIDEO_INPUT:
+    case blink::MediaDeviceType::MEDIA_DEVICE_TYPE_VIDEO_INPUT:
       return blink::mojom::MediaDeviceType::MEDIA_VIDEO_INPUT;
-    case content::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT:
+    case blink::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT:
       return blink::mojom::MediaDeviceType::MEDIA_AUDIO_OUTPUT;
     default:
       break;
@@ -27,18 +27,18 @@
 }
 
 // static
-bool EnumTraits<blink::mojom::MediaDeviceType, content::MediaDeviceType>::
+bool EnumTraits<blink::mojom::MediaDeviceType, blink::MediaDeviceType>::
     FromMojom(blink::mojom::MediaDeviceType input,
-              content::MediaDeviceType* out) {
+              blink::MediaDeviceType* out) {
   switch (input) {
     case blink::mojom::MediaDeviceType::MEDIA_AUDIO_INPUT:
-      *out = content::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_INPUT;
+      *out = blink::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_INPUT;
       return true;
     case blink::mojom::MediaDeviceType::MEDIA_VIDEO_INPUT:
-      *out = content::MediaDeviceType::MEDIA_DEVICE_TYPE_VIDEO_INPUT;
+      *out = blink::MediaDeviceType::MEDIA_DEVICE_TYPE_VIDEO_INPUT;
       return true;
     case blink::mojom::MediaDeviceType::MEDIA_AUDIO_OUTPUT:
-      *out = content::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
+      *out = blink::MediaDeviceType::MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
       return true;
     default:
       break;
@@ -87,10 +87,10 @@
 }
 
 // static
-bool StructTraits<
-    blink::mojom::MediaDeviceInfoDataView,
-    content::MediaDeviceInfo>::Read(blink::mojom::MediaDeviceInfoDataView input,
-                                    content::MediaDeviceInfo* out) {
+bool StructTraits<blink::mojom::MediaDeviceInfoDataView,
+                  blink::WebMediaDeviceInfo>::
+    Read(blink::mojom::MediaDeviceInfoDataView input,
+         blink::WebMediaDeviceInfo* out) {
   if (!input.ReadDeviceId(&out->device_id))
     return false;
   if (!input.ReadLabel(&out->label))
diff --git a/content/common/media/media_devices_unittest.cc b/third_party/blink/common/mediastream/media_devices_unittest.cc
similarity index 81%
rename from content/common/media/media_devices_unittest.cc
rename to third_party/blink/common/mediastream/media_devices_unittest.cc
index 086f0d1..143ca9d 100644
--- a/content/common/media/media_devices_unittest.cc
+++ b/third_party/blink/common/mediastream/media_devices_unittest.cc
@@ -2,21 +2,21 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/common/media/media_devices.h"
+#include "third_party/blink/public/common/mediastream/media_devices.h"
 #include "media/audio/audio_device_description.h"
 #include "media/capture/video/video_capture_device_descriptor.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-namespace content {
+namespace blink {
 
 TEST(MediaDevicesTest, MediaDeviceInfoFromVideoDescriptor) {
   media::VideoCaptureDeviceDescriptor descriptor(
       "display_name", "device_id", "model_id", media::VideoCaptureApi::UNKNOWN);
 
   // TODO(guidou): Add test for group ID when supported. See crbug.com/627793.
-  MediaDeviceInfo device_info(descriptor);
+  WebMediaDeviceInfo device_info(descriptor);
   EXPECT_EQ(descriptor.device_id, device_info.device_id);
   EXPECT_EQ(descriptor.GetNameAndModel(), device_info.label);
 }
 
-}  // namespace content
+}  // namespace blink
diff --git a/third_party/blink/public/BUILD.gn b/third_party/blink/public/BUILD.gn
index 46472e9..a9e3ac7f 100644
--- a/third_party/blink/public/BUILD.gn
+++ b/third_party/blink/public/BUILD.gn
@@ -736,22 +736,6 @@
   export_header_blink = "third_party/blink/public/platform/web_common.h"
 }
 
-mojom("media_devices_mojo_bindings") {
-  sources = [
-    "platform/modules/mediastream/media_devices.mojom",
-  ]
-
-  public_deps = [
-    "//media/capture/mojom:video_capture",
-    "//media/mojo/interfaces",
-    "//ui/gfx/geometry/mojo",
-  ]
-
-  export_class_attribute = "CONTENT_EXPORT"
-  export_define = "CONTENT_IMPLEMENTATION=1"
-  export_header = "content/common/content_export.h"
-}
-
 # The embedded_frame_sink_mojo_bindings is separated from the rest of mojom
 # files because its deps contain too many files in Chromium that would pollute
 # the include paths in generated mojom-blink files for other services.
@@ -818,8 +802,6 @@
     ":core_mojo_bindings_blink_headers",
     ":core_mojo_bindings_headers",
     ":embedded_frame_sink_mojo_bindings_blink_headers",
-    ":media_devices_mojo_bindings_blink_headers",
-    ":media_devices_mojo_bindings_headers",
     ":mojo_bindings_blink_headers",
     ":mojo_bindings_headers",
   ]
diff --git a/third_party/blink/public/common/BUILD.gn b/third_party/blink/public/common/BUILD.gn
index ec576c4..466f90a 100644
--- a/third_party/blink/public/common/BUILD.gn
+++ b/third_party/blink/public/common/BUILD.gn
@@ -65,6 +65,8 @@
     "manifest/manifest.h",
     "manifest/manifest_icon_selector.h",
     "manifest/web_display_mode.h",
+    "mediastream/media_devices.h",
+    "mediastream/media_devices_mojom_traits.h",
     "mediastream/media_stream_controls.h",
     "mediastream/media_stream_mojom_traits.h",
     "mediastream/media_stream_request.h",
diff --git a/third_party/blink/public/common/mediastream/media_devices.h b/third_party/blink/public/common/mediastream/media_devices.h
new file mode 100644
index 0000000..d87affe
--- /dev/null
+++ b/third_party/blink/public/common/mediastream/media_devices.h
@@ -0,0 +1,59 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_MEDIASTREAM_MEDIA_DEVICES_H_
+#define THIRD_PARTY_BLINK_PUBLIC_COMMON_MEDIASTREAM_MEDIA_DEVICES_H_
+
+#include <string>
+#include <vector>
+
+#include "media/base/video_facing.h"
+#include "third_party/blink/public/common/common_export.h"
+
+namespace media {
+struct VideoCaptureDeviceDescriptor;
+}  // namespace media
+
+namespace blink {
+
+enum MediaDeviceType {
+  MEDIA_DEVICE_TYPE_AUDIO_INPUT,
+  MEDIA_DEVICE_TYPE_VIDEO_INPUT,
+  MEDIA_DEVICE_TYPE_AUDIO_OUTPUT,
+  NUM_MEDIA_DEVICE_TYPES,
+};
+
+struct BLINK_COMMON_EXPORT WebMediaDeviceInfo {
+  WebMediaDeviceInfo();
+  WebMediaDeviceInfo(const WebMediaDeviceInfo& other);
+  WebMediaDeviceInfo(WebMediaDeviceInfo&& other);
+  WebMediaDeviceInfo(
+      const std::string& device_id,
+      const std::string& label,
+      const std::string& group_id,
+      media::VideoFacingMode video_facing = media::MEDIA_VIDEO_FACING_NONE);
+  explicit WebMediaDeviceInfo(
+      const media::VideoCaptureDeviceDescriptor& descriptor);
+  ~WebMediaDeviceInfo();
+  WebMediaDeviceInfo& operator=(const WebMediaDeviceInfo& other);
+  WebMediaDeviceInfo& operator=(WebMediaDeviceInfo&& other);
+
+  std::string device_id;
+  std::string label;
+  std::string group_id;
+  media::VideoFacingMode video_facing;
+};
+
+using WebMediaDeviceInfoArray = std::vector<WebMediaDeviceInfo>;
+
+BLINK_COMMON_EXPORT bool operator==(const WebMediaDeviceInfo& first,
+                                    const WebMediaDeviceInfo& second);
+
+inline bool IsValidMediaDeviceType(MediaDeviceType type) {
+  return type >= 0 && type < NUM_MEDIA_DEVICE_TYPES;
+}
+
+}  // namespace blink
+
+#endif  // THIRD_PARTY_BLINK_PUBLIC_COMMON_MEDIASTREAM_MEDIA_DEVICES_H_
diff --git a/third_party/blink/public/common/mediastream/media_devices.typemap b/third_party/blink/public/common/mediastream/media_devices.typemap
new file mode 100644
index 0000000..763f9fc
--- /dev/null
+++ b/third_party/blink/public/common/mediastream/media_devices.typemap
@@ -0,0 +1,20 @@
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+mojom = "//third_party/blink/public/mojom/mediastream/media_devices.mojom"
+
+public_headers = [
+  "//third_party/blink/public/common/mediastream/media_devices.h",
+  "//third_party/blink/public/common/common_export.h",
+]
+
+traits_headers = [
+  "//third_party/blink/public/common/mediastream/media_devices_mojom_traits.h",
+]
+
+type_mappings = [
+  "blink.mojom.MediaDeviceType=blink::MediaDeviceType",
+  "blink.mojom.MediaDeviceInfo=blink::WebMediaDeviceInfo",
+  "blink.mojom.FacingMode=media::VideoFacingMode",
+]
diff --git a/third_party/blink/public/common/mediastream/media_devices_mojom_traits.h b/third_party/blink/public/common/mediastream/media_devices_mojom_traits.h
new file mode 100644
index 0000000..34d0413
--- /dev/null
+++ b/third_party/blink/public/common/mediastream/media_devices_mojom_traits.h
@@ -0,0 +1,50 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_MEDIASTREAM_MEDIA_DEVICES_MOJOM_TRAITS_H_
+#define THIRD_PARTY_BLINK_PUBLIC_COMMON_MEDIASTREAM_MEDIA_DEVICES_MOJOM_TRAITS_H_
+
+#include "third_party/blink/public/common/mediastream/media_devices.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom.h"
+
+namespace mojo {
+
+template <>
+struct EnumTraits<blink::mojom::MediaDeviceType, blink::MediaDeviceType> {
+  static blink::mojom::MediaDeviceType ToMojom(blink::MediaDeviceType type);
+
+  static bool FromMojom(blink::mojom::MediaDeviceType input,
+                        blink::MediaDeviceType* out);
+};
+
+template <>
+struct EnumTraits<blink::mojom::FacingMode, media::VideoFacingMode> {
+  static blink::mojom::FacingMode ToMojom(media::VideoFacingMode facing_mode);
+
+  static bool FromMojom(blink::mojom::FacingMode input,
+                        media::VideoFacingMode* out);
+};
+
+template <>
+struct StructTraits<blink::mojom::MediaDeviceInfoDataView,
+                    blink::WebMediaDeviceInfo> {
+  static const std::string& device_id(const blink::WebMediaDeviceInfo& info) {
+    return info.device_id;
+  }
+
+  static const std::string& label(const blink::WebMediaDeviceInfo& info) {
+    return info.label;
+  }
+
+  static const std::string& group_id(const blink::WebMediaDeviceInfo& info) {
+    return info.group_id;
+  }
+
+  static bool Read(blink::mojom::MediaDeviceInfoDataView input,
+                   blink::WebMediaDeviceInfo* out);
+};
+
+}  // namespace mojo
+
+#endif  // THIRD_PARTY_BLINK_PUBLIC_COMMON_MEDIASTREAM_MEDIA_DEVICES_MOJOM_TRAITS_H_
diff --git a/third_party/blink/public/mojom/BUILD.gn b/third_party/blink/public/mojom/BUILD.gn
index 93a8cf8..ce9a1ab 100644
--- a/third_party/blink/public/mojom/BUILD.gn
+++ b/third_party/blink/public/mojom/BUILD.gn
@@ -51,6 +51,7 @@
     "manifest/display_mode.mojom",
     "manifest/manifest.mojom",
     "manifest/manifest_manager.mojom",
+    "mediastream/media_devices.mojom",
     "mediastream/media_stream.mojom",
     "net/ip_address_space.mojom",
     "notifications/notification.mojom",
diff --git a/third_party/blink/public/platform/modules/mediastream/media_devices.mojom b/third_party/blink/public/mojom/mediastream/media_devices.mojom
similarity index 100%
rename from third_party/blink/public/platform/modules/mediastream/media_devices.mojom
rename to third_party/blink/public/mojom/mediastream/media_devices.mojom
diff --git a/third_party/blink/public/platform/modules/mediastream/OWNERS b/third_party/blink/public/platform/modules/mediastream/OWNERS
deleted file mode 100644
index 08850f4..0000000
--- a/third_party/blink/public/platform/modules/mediastream/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-per-file *.mojom=set noparent
-per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/third_party/blink/public/public_typemaps.gni b/third_party/blink/public/public_typemaps.gni
index 85b04c5..7946b83 100644
--- a/third_party/blink/public/public_typemaps.gni
+++ b/third_party/blink/public/public_typemaps.gni
@@ -9,6 +9,7 @@
   "//third_party/blink/public/common/loader/url_loader_factory_bundle.typemap",
   "//third_party/blink/public/common/manifest/display_mode.typemap",
   "//third_party/blink/public/common/manifest/manifest.typemap",
+  "//third_party/blink/public/common/mediastream/media_devices.typemap",
   "//third_party/blink/public/common/mediastream/media_stream.typemap",
   "//third_party/blink/public/common/notifications/notification_types.typemap",
   "//third_party/blink/public/common/screen_orientation/screen_orientation_lock_types.typemap",
diff --git a/third_party/blink/renderer/bindings/modules/v8/BUILD.gn b/third_party/blink/renderer/bindings/modules/v8/BUILD.gn
index 2ca7b7e..8a0f890 100644
--- a/third_party/blink/renderer/bindings/modules/v8/BUILD.gn
+++ b/third_party/blink/renderer/bindings/modules/v8/BUILD.gn
@@ -103,7 +103,6 @@
     "//services/device/public/mojom:generic_sensor_headers",
     "//services/device/public/mojom:mojom_blink_headers",
     "//services/shape_detection/public/mojom:mojom_blink_headers",
-    "//third_party/blink/public:media_devices_mojo_bindings_blink_headers",
 
     # IndexedDB Mojom Blink headers are provided by the mojom_modules
     # target.
diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn
index 278a097..6ca117d 100644
--- a/third_party/blink/renderer/modules/BUILD.gn
+++ b/third_party/blink/renderer/modules/BUILD.gn
@@ -372,7 +372,6 @@
     "//skia",
     "//testing/gmock",
     "//testing/gtest",
-    "//third_party/blink/public:media_devices_mojo_bindings_blink",
     "//third_party/blink/renderer/core",
     "//third_party/blink/renderer/modules/storage:unit_tests",
     "//third_party/blink/renderer/platform",
diff --git a/third_party/blink/renderer/modules/mediastream/BUILD.gn b/third_party/blink/renderer/modules/mediastream/BUILD.gn
index 00f60af..418f198 100644
--- a/third_party/blink/renderer/modules/mediastream/BUILD.gn
+++ b/third_party/blink/renderer/modules/mediastream/BUILD.gn
@@ -41,8 +41,4 @@
     "user_media_request.cc",
     "user_media_request.h",
   ]
-
-  deps = [
-    "//third_party/blink/public:media_devices_mojo_bindings_blink",
-  ]
 }
diff --git a/third_party/blink/renderer/modules/mediastream/media_device_info.h b/third_party/blink/renderer/modules/mediastream/media_device_info.h
index 737a37b..d91fa45 100644
--- a/third_party/blink/renderer/modules/mediastream/media_device_info.h
+++ b/third_party/blink/renderer/modules/mediastream/media_device_info.h
@@ -26,7 +26,7 @@
 #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASTREAM_MEDIA_DEVICE_INFO_H_
 #define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASTREAM_MEDIA_DEVICE_INFO_H_
 
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom-blink.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom-blink.h"
 #include "third_party/blink/renderer/modules/modules_export.h"
 #include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
 #include "third_party/blink/renderer/platform/heap/heap_allocator.h"
diff --git a/third_party/blink/renderer/modules/mediastream/media_devices.h b/third_party/blink/renderer/modules/mediastream/media_devices.h
index aff61a7..59dfeae 100644
--- a/third_party/blink/renderer/modules/mediastream/media_devices.h
+++ b/third_party/blink/renderer/modules/mediastream/media_devices.h
@@ -7,7 +7,7 @@
 
 #include "base/callback.h"
 #include "mojo/public/cpp/bindings/binding.h"
-#include "third_party/blink/public/platform/modules/mediastream/media_devices.mojom-blink.h"
+#include "third_party/blink/public/mojom/mediastream/media_devices.mojom-blink.h"
 #include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h"
 #include "third_party/blink/renderer/core/dom/context_lifecycle_observer.h"
 #include "third_party/blink/renderer/core/dom/events/event_target.h"