OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 5 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
748 queue.erase(it); | 748 queue.erase(it); |
749 found = true; | 749 found = true; |
750 break; | 750 break; |
751 } | 751 } |
752 } | 752 } |
753 if (found) | 753 if (found) |
754 break; | 754 break; |
755 } | 755 } |
756 } | 756 } |
757 | 757 |
758 #if defined(OS_CHROMEOS) | |
759 // Notify ash that screen sharing state has changed. | |
760 if (device.type == content::MEDIA_TAB_VIDEO_CAPTURE || | |
761 device.type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) { | |
762 if (state == content::MEDIA_REQUEST_STATE_DONE) { | |
763 ash::Shell::GetInstance()->OnScreenSharingStateChanged(true); | |
Sergey Ulanov
2014/01/15 22:23:45
can ash::Shell register itself as an observer?
Daniel Erat
2014/01/15 22:42:59
like haixia said, this would only be possible if t
| |
764 } else if (state == content::MEDIA_REQUEST_STATE_CLOSING) { | |
765 ash::Shell::GetInstance()->OnScreenSharingStateChanged(false); | |
766 } | |
767 } | |
768 #endif | |
769 | |
758 FOR_EACH_OBSERVER(Observer, observers_, | 770 FOR_EACH_OBSERVER(Observer, observers_, |
759 OnRequestUpdate(render_process_id, | 771 OnRequestUpdate(render_process_id, |
760 render_view_id, | 772 render_view_id, |
761 device, | 773 device, |
762 state)); | 774 state)); |
763 } | 775 } |
764 | 776 |
765 void MediaCaptureDevicesDispatcher::OnCreatingAudioStreamOnUIThread( | 777 void MediaCaptureDevicesDispatcher::OnCreatingAudioStreamOnUIThread( |
766 int render_process_id, | 778 int render_process_id, |
767 int render_view_id) { | 779 int render_view_id) { |
768 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 780 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
769 FOR_EACH_OBSERVER(Observer, observers_, | 781 FOR_EACH_OBSERVER(Observer, observers_, |
770 OnCreatingAudioStream(render_process_id, render_view_id)); | 782 OnCreatingAudioStream(render_process_id, render_view_id)); |
771 } | 783 } |
772 | 784 |
773 bool MediaCaptureDevicesDispatcher::IsDesktopCaptureInProgress() { | 785 bool MediaCaptureDevicesDispatcher::IsDesktopCaptureInProgress() { |
774 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 786 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
775 return desktop_capture_sessions_.size() > 0; | 787 return desktop_capture_sessions_.size() > 0; |
776 } | 788 } |
OLD | NEW |