| Index: chrome/browser/ui/webui/options/media_devices_selection_handler.cc
|
| diff --git a/chrome/browser/ui/webui/options/media_devices_selection_handler.cc b/chrome/browser/ui/webui/options/media_devices_selection_handler.cc
|
| index cb5009b15215ceb27225ae6385ea18147f380cb6..445562d51654153fc0289219a70ee28de3f68240 100644
|
| --- a/chrome/browser/ui/webui/options/media_devices_selection_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/media_devices_selection_handler.cc
|
| @@ -16,6 +16,11 @@
|
| #include "chrome/grit/generated_resources.h"
|
| #include "components/prefs/pref_service.h"
|
|
|
| +#if BUILDFLAG(ENABLE_EXTENSIONS)
|
| +#include "extensions/strings/grit/extensions_strings.h"
|
| +#include "ui/base/l10n/l10n_util.h"
|
| +#endif
|
| +
|
| namespace {
|
|
|
| const char kAudio[] = "mic";
|
| @@ -113,7 +118,7 @@ void MediaDevicesSelectionHandler::UpdateDevicesMenu(
|
| base::ListValue device_list;
|
| for (size_t i = 0; i < devices.size(); ++i) {
|
| std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue());
|
| - entry->SetString("name", devices[i].name);
|
| + entry->SetString("name", GetDeviceDisplayName(devices[i]));
|
| entry->SetString("id", devices[i].id);
|
| device_list.Append(std::move(entry));
|
| if (devices[i].id == default_device)
|
| @@ -132,6 +137,31 @@ void MediaDevicesSelectionHandler::UpdateDevicesMenu(
|
| default_value);
|
| }
|
|
|
| +std::string MediaDevicesSelectionHandler::GetDeviceDisplayName(
|
| + const content::MediaStreamDevice& device) const {
|
| + std::string facing_info;
|
| +
|
| +#if BUILDFLAG(ENABLE_EXTENSIONS)
|
| + switch (device.video_facing) {
|
| + case media::VideoFacingMode::MEDIA_VIDEO_FACING_USER:
|
| + facing_info = l10n_util::GetStringUTF8(IDS_CAMERA_FACING_USER);
|
| + break;
|
| + case media::VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT:
|
| + facing_info = l10n_util::GetStringUTF8(IDS_CAMERA_FACING_ENVIRONMENT);
|
| + break;
|
| + case media::VideoFacingMode::MEDIA_VIDEO_FACING_NONE:
|
| + break;
|
| + case media::VideoFacingMode::NUM_MEDIA_VIDEO_FACING_MODES:
|
| + NOTREACHED();
|
| + break;
|
| + }
|
| +#endif
|
| +
|
| + if (facing_info.empty())
|
| + return device.name;
|
| + return device.name + " " + facing_info;
|
| +}
|
| +
|
| void MediaDevicesSelectionHandler::UpdateDevicesMenuForType(DeviceType type) {
|
| content::MediaStreamDevices devices;
|
| switch (type) {
|
|
|