| 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/ui/tabs/tab_utils.h" | 5 #include "chrome/browser/ui/tabs/tab_utils.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "chrome/browser/media/audio_stream_monitor.h" | 8 #include "chrome/browser/media/audio_stream_monitor.h" |
| 9 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 9 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 10 #include "chrome/browser/media/media_stream_capture_indicator.h" | 10 #include "chrome/browser/media/media_stream_capture_indicator.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return audio_stream_monitor && audio_stream_monitor->WasRecentlyAudible(); | 122 return audio_stream_monitor && audio_stream_monitor->WasRecentlyAudible(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 TabMediaState GetTabMediaStateForContents(content::WebContents* contents) { | 125 TabMediaState GetTabMediaStateForContents(content::WebContents* contents) { |
| 126 if (!contents) | 126 if (!contents) |
| 127 return TAB_MEDIA_STATE_NONE; | 127 return TAB_MEDIA_STATE_NONE; |
| 128 | 128 |
| 129 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 129 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
| 130 MediaCaptureDevicesDispatcher::GetInstance()-> | 130 MediaCaptureDevicesDispatcher::GetInstance()-> |
| 131 GetMediaStreamCaptureIndicator(); | 131 GetMediaStreamCaptureIndicator(); |
| 132 if (indicator) { | 132 if (indicator.get()) { |
| 133 if (indicator->IsBeingMirrored(contents)) | 133 if (indicator->IsBeingMirrored(contents)) |
| 134 return TAB_MEDIA_STATE_CAPTURING; | 134 return TAB_MEDIA_STATE_CAPTURING; |
| 135 if (indicator->IsCapturingUserMedia(contents)) | 135 if (indicator->IsCapturingUserMedia(contents)) |
| 136 return TAB_MEDIA_STATE_RECORDING; | 136 return TAB_MEDIA_STATE_RECORDING; |
| 137 } | 137 } |
| 138 | 138 |
| 139 if (IsPlayingAudio(contents)) | 139 if (IsPlayingAudio(contents)) |
| 140 return TAB_MEDIA_STATE_AUDIO_PLAYING; | 140 return TAB_MEDIA_STATE_AUDIO_PLAYING; |
| 141 | 141 |
| 142 return TAB_MEDIA_STATE_NONE; | 142 return TAB_MEDIA_STATE_NONE; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_MEDIA_STATE_CAPTURING)); | 202 l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_MEDIA_STATE_CAPTURING)); |
| 203 break; | 203 break; |
| 204 case TAB_MEDIA_STATE_NONE: | 204 case TAB_MEDIA_STATE_NONE: |
| 205 NOTREACHED(); | 205 NOTREACHED(); |
| 206 break; | 206 break; |
| 207 } | 207 } |
| 208 return result; | 208 return result; |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace chrome | 211 } // namespace chrome |
| OLD | NEW |