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

Side by Side Diff: chrome/browser/media/audio_stream_indicator.h

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: fix Created 8 years 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_MEDIA_AUDIO_STREAM_INDICATOR_H_
6 #define CHROME_BROWSER_MEDIA_AUDIO_STREAM_INDICATOR_H_
7
8 #include <set>
9
10 #include "base/memory/ref_counted.h"
11
12 namespace content {
13 class WebContents;
14 }
15
16 class AudioStreamIndicator
17 : public base::RefCountedThreadSafe<AudioStreamIndicator> {
18 public:
19 AudioStreamIndicator();
20
21 // This method should be called on the IO thread.
22 void UpdateWebContentsStatus(int render_process_id,
23 int render_view_id,
miu 2012/12/19 00:49:08 Please fix indentation here.
Bernhard Bauer 2013/02/05 18:45:18 Done.
24 bool playing);
25
26 // This method should be called on the IO thread.
27 bool IsPlayingAudio(content::WebContents* contents);
28
29 private:
30 friend class base::RefCountedThreadSafe<AudioStreamIndicator>;
31 virtual ~AudioStreamIndicator();
32
33 void UpdateWebContentsStatusOnUIThread(int render_process_id,
34 int render_view_id,
miu 2012/12/19 00:49:08 Ditto (fix indentation).
Bernhard Bauer 2013/02/05 18:45:18 Done.
35 bool playing);
36
37 std::multiset<std::pair<int, int> > audio_streams_;
miu 2012/12/19 00:49:08 Please document this member. I assume it's the se
miu 2012/12/19 00:49:08 Why is this a multiset<>? Won't a set<> do the jo
tommi (sloooow) - chröme 2012/12/19 11:47:29 Instead of using std::pair, let's just define a pr
Bernhard Bauer 2013/02/05 18:45:18 Done.
Bernhard Bauer 2013/02/05 18:45:18 Done.
Bernhard Bauer 2013/02/05 18:45:18 It's a multiset because it has one entry per audio
38 };
39
40 #endif // CHROME_BROWSER_MEDIA_AUDIO_STREAM_INDICATOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/audio_stream_indicator.cc » ('j') | chrome/browser/media/audio_stream_indicator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698