Chromium Code Reviews| Index: media/capture/video/video_capture_device_descriptor.cc |
| diff --git a/media/capture/video/video_capture_device_descriptor.cc b/media/capture/video/video_capture_device_descriptor.cc |
| index 3a259543979580ebe3b6680c2e9113136d1640db..b26cd2039278d044aba319f71f4e5a154d0f6b09 100644 |
| --- a/media/capture/video/video_capture_device_descriptor.cc |
| +++ b/media/capture/video/video_capture_device_descriptor.cc |
| @@ -6,6 +6,12 @@ |
| #include "base/logging.h" |
| +namespace { |
| + |
| +const char* VIDEO_FACING_STRINGS[media::NUM_MEDIA_VIDEO_FACING_MODE] = { |
| + "", "user-facing", "world-facing"}; |
|
mcasas
2017/02/22 19:03:59
nit: move the anonymous namespace inside media,
shenghao
2017/02/24 01:11:39
Deleted
|
| +} |
| + |
| namespace media { |
| VideoCaptureDeviceDescriptor::VideoCaptureDeviceDescriptor() |
| @@ -94,4 +100,12 @@ std::string VideoCaptureDeviceDescriptor::GetNameAndModel() const { |
| return display_name + " (" + model_id + ")"; |
| } |
| +std::string VideoCaptureDeviceDescriptor::GetHumanReadableName() const { |
| + std::string facing_info(VIDEO_FACING_STRINGS[facing]); |
| + if (facing_info.empty()) { |
| + return GetNameAndModel(); |
| + } |
|
mcasas
2017/02/22 19:03:59
nit: no {} for one-line bodies.
shenghao
2017/02/24 01:11:39
Done.
|
| + return GetNameAndModel() + " (" + facing_info + ")"; |
|
mtomasz
2017/02/22 03:20:37
If human readable, then should we localize? If har
tommi (sloooow) - chröme
2017/02/22 10:41:04
I don't think we have a way of knowing what langua
shenghao
2017/02/24 01:11:39
Replied in previous comment.
|
| +} |
| + |
| } // namespace media |