Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/ui/tabs/tab_utils.cc

Issue 11573066: Add a method to tab_utils.h to find out whether a tab is playing audio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/tabs/tab_utils.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/media/audio_stream_indicator.h"
7 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 8 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
8 #include "chrome/browser/media/media_stream_capture_indicator.h" 9 #include "chrome/browser/media/media_stream_capture_indicator.h"
9 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
10 #include "content/public/browser/render_view_host.h" 11 #include "content/public/browser/render_view_host.h"
11 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
12 13
13 namespace chrome { 14 namespace chrome {
14 15
15 bool ShouldShowProjectingIndicator(content::WebContents* contents) { 16 bool ShouldShowProjectingIndicator(content::WebContents* contents) {
16 int render_process_id = contents->GetRenderProcessHost()->GetID(); 17 int render_process_id = contents->GetRenderProcessHost()->GetID();
(...skipping 10 matching lines...) Expand all
27 scoped_refptr<MediaStreamCaptureIndicator> indicator = 28 scoped_refptr<MediaStreamCaptureIndicator> indicator =
28 MediaCaptureDevicesDispatcher::GetInstance()-> 29 MediaCaptureDevicesDispatcher::GetInstance()->
29 GetMediaStreamCaptureIndicator(); 30 GetMediaStreamCaptureIndicator();
30 // The projecting indicator takes precedence over the recording indicator, but 31 // The projecting indicator takes precedence over the recording indicator, but
31 // if we are projecting and we don't handle the projecting case we want to 32 // if we are projecting and we don't handle the projecting case we want to
32 // still show the recording indicator. 33 // still show the recording indicator.
33 return indicator->IsCapturingUserMedia(render_process_id, render_view_id) || 34 return indicator->IsCapturingUserMedia(render_process_id, render_view_id) ||
34 indicator->IsBeingMirrored(render_process_id, render_view_id); 35 indicator->IsBeingMirrored(render_process_id, render_view_id);
35 } 36 }
36 37
38 bool ShouldShowAudioIndicator(content::WebContents* contents) {
39 AudioStreamIndicator* audio_indicator =
40 MediaCaptureDevicesDispatcher::GetInstance()->GetAudioStreamIndicator();
41 return audio_indicator->IsPlayingAudio(contents);
42 }
43
37 } // namespace chrome 44 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_utils.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698