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

Unified Diff: content/browser/media/audio_stream_monitor.h

Issue 757033005: Make tab audible and muted states and cause available for an extension API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/media/audio_stream_monitor.h
diff --git a/content/browser/media/audio_stream_monitor.h b/content/browser/media/audio_stream_monitor.h
index d1a32d5f857b05925f884ef64d834e673c8c5f29..cf8f15587e5f11fc6052b106ad7a52dc20b93369 100644
--- a/content/browser/media/audio_stream_monitor.h
+++ b/content/browser/media/audio_stream_monitor.h
@@ -22,7 +22,6 @@ class TickClock;
}
namespace content {
-class WebContents;
// Repeatedly polls audio streams for their power levels, and "debounces" the
// information into a simple, binary "was recently audible" result for the audio
@@ -35,7 +34,9 @@ class WebContents;
// Each WebContentsImpl owns an AudioStreamMonitor.
class CONTENT_EXPORT AudioStreamMonitor {
public:
- explicit AudioStreamMonitor(WebContents* contents);
+ using AudibleChangeCallback = base::Callback<void(bool)>;
+
+ explicit AudioStreamMonitor(const AudibleChangeCallback& callback);
~AudioStreamMonitor();
// Indicates if audio stream monitoring is available. It's only available if
@@ -112,10 +113,8 @@ class CONTENT_EXPORT AudioStreamMonitor {
// on, |off_timer_| is started to re-invoke this method in the future.
void MaybeToggle();
- // The WebContents instance instance to receive indicator toggle
- // notifications. This pointer should be valid for the lifetime of
- // AudioStreamMonitor.
- WebContents* const web_contents_;
+ // The Callback to run to receive indicator toggle notifications.
+ const AudibleChangeCallback audible_change_callback_;
// Note: |clock_| is always |&default_tick_clock_|, except during unit
// testing.

Powered by Google App Engine
This is Rietveld 408576698