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

Side by Side Diff: content/public/browser/media_observer.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
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 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_
6 #define CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ 6 #define CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_
7 7
8 #include "content/public/browser/media_request_state.h" 8 #include "content/public/browser/media_request_state.h"
9 #include "content/public/common/media_stream_request.h" 9 #include "content/public/common/media_stream_request.h"
10 10
11 namespace media { 11 namespace media {
12 struct MediaLogEvent; 12 struct MediaLogEvent;
13 } 13 }
14 14
15 namespace content { 15 namespace content {
16 16
17 // An embedder may implement MediaObserver and return it from 17 // An embedder may implement MediaObserver and return it from
18 // ContentBrowserClient to receive callbacks as media events occur. 18 // ContentBrowserClient to receive callbacks as media events occur.
19 class MediaObserver { 19 class MediaObserver {
20 public: 20 public:
21 // Called when an audio stream is deleted. 21 // Called when an audio stream is deleted.
22 virtual void OnDeleteAudioStream(void* host, int stream_id) = 0; 22 virtual void OnDeleteAudioStream(void* host, int stream_id) = 0;
23 23
24 // Called when an audio stream is set to playing or paused. 24 // Called when an audio stream is set to playing or paused.
25 virtual void OnSetAudioStreamPlaying(void* host, int stream_id, 25 virtual void OnSetAudioStreamPlaying(void* host,
26 int stream_id,
27 int render_process_id,
28 int render_view_id,
26 bool playing) = 0; 29 bool playing) = 0;
27 30
28 // Called when the status of an audio stream is set to "created", "flushed", 31 // Called when the status of an audio stream is set to "created", "flushed",
29 // "closed", or "error". 32 // "closed", or "error".
30 virtual void OnSetAudioStreamStatus(void* host, int stream_id, 33 virtual void OnSetAudioStreamStatus(void* host, int stream_id,
31 const std::string& status) = 0; 34 const std::string& status) = 0;
32 35
33 // Called when the volume of an audio stream is set. 36 // Called when the volume of an audio stream is set.
34 virtual void OnSetAudioStreamVolume(void* host, int stream_id, 37 virtual void OnSetAudioStreamVolume(void* host, int stream_id,
35 double volume) = 0; 38 double volume) = 0;
(...skipping 29 matching lines...) Expand all
65 const MediaStreamDevice& device, 68 const MediaStreamDevice& device,
66 MediaRequestState state) = 0; 69 MediaRequestState state) = 0;
67 70
68 protected: 71 protected:
69 virtual ~MediaObserver() {} 72 virtual ~MediaObserver() {}
70 }; 73 };
71 74
72 } // namespace content 75 } // namespace content
73 76
74 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ 77 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698