Chromium Code Reviews| Index: chrome/browser/media/media_capture_devices_dispatcher.cc |
| diff --git a/chrome/browser/media/media_capture_devices_dispatcher.cc b/chrome/browser/media/media_capture_devices_dispatcher.cc |
| index 29c7afbec8d820c24b7dbcf33b752af116bfd7db..75bd24cde66679aa07c78477b38552afcec66291 100644 |
| --- a/chrome/browser/media/media_capture_devices_dispatcher.cc |
| +++ b/chrome/browser/media/media_capture_devices_dispatcher.cc |
| @@ -39,6 +39,7 @@ |
| #if defined(OS_CHROMEOS) |
| #include "ash/shell.h" |
| +#include "chromeos/display/output_configurator.h" |
| #endif // defined(OS_CHROMEOS) |
| using content::BrowserThread; |
| @@ -170,7 +171,8 @@ MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher() |
| : devices_enumerated_(false), |
| is_device_enumeration_disabled_(false), |
| media_stream_capture_indicator_(new MediaStreamCaptureIndicator()), |
| - audio_stream_indicator_(new AudioStreamIndicator()) { |
| + audio_stream_indicator_(new AudioStreamIndicator()), |
| + screen_sharing_count_(0) { |
| // MediaCaptureDevicesDispatcher is a singleton. It should be created on |
| // UI thread. Otherwise, it will not receive |
| // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in |
| @@ -734,6 +736,23 @@ void MediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread( |
| } |
| } |
| + // Updates count of screen sharing sessions. |
| + if (device.type == content::MEDIA_TAB_VIDEO_CAPTURE || |
| + device.type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) { |
| + if (state == content::MEDIA_REQUEST_STATE_DONE) { |
| + ++screen_sharing_count_; |
| + } else if (state == content::MEDIA_REQUEST_STATE_CLOSING) { |
| + DCHECK_GT(screen_sharing_count_, 0); |
| + --screen_sharing_count_; |
| + } |
| +#if defined(OS_CHROMEOS) |
| + chromeos::OutputConfigurator* configurator = |
|
Sergey Ulanov
2014/01/15 02:51:20
Can OutputConfigurator register to observe media s
hshi1
2014/01/15 19:43:24
Done.
|
| + ash::Shell::GetInstance()->output_configurator(); |
| + if (configurator) |
|
Daniel Erat
2014/01/15 15:08:55
nit (maybe made obsolete by sergey's comment above
hshi1
2014/01/15 19:43:24
(this no longer applies)
|
| + configurator->SetScreenSharingCount(screen_sharing_count_); |
| +#endif |
| + } |
| + |
| // Cancel the request. |
| if (state == content::MEDIA_REQUEST_STATE_CLOSING) { |
| bool found = false; |