| Index: chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.cc
|
| diff --git a/chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.cc b/chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.cc
|
| index 77f77fb20fcffcb1ac45d1868e8a942e0fc74bef..8070f70474065e1cf26a5eaa0c0b0a6dc48c085e 100644
|
| --- a/chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.cc
|
| +++ b/chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.cc
|
| @@ -15,6 +15,11 @@
|
| #include "chrome/common/pref_names.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";
|
| @@ -120,7 +125,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)
|
| @@ -141,6 +146,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) {
|
|
|