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

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

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.cc
diff --git a/content/browser/media/audio_stream_monitor.cc b/content/browser/media/audio_stream_monitor.cc
index 1d2f76f7f2c02f986f5b52122834363ff96be1e8..336063069eda096fca779ca61d4069866c8e2167 100644
--- a/content/browser/media/audio_stream_monitor.cc
+++ b/content/browser/media/audio_stream_monitor.cc
@@ -26,11 +26,11 @@ AudioStreamMonitor* AudioStreamMonitorFromRenderFrame(int render_process_id,
} // namespace
-AudioStreamMonitor::AudioStreamMonitor(WebContents* contents)
- : web_contents_(contents),
+AudioStreamMonitor::AudioStreamMonitor(const AudibleChangeCallback& callback)
+ : audible_change_callback_(callback),
clock_(&default_tick_clock_),
was_recently_audible_(false) {
- DCHECK(web_contents_);
+ DCHECK(!audible_change_callback_.is_null());
}
AudioStreamMonitor::~AudioStreamMonitor() {}
@@ -146,7 +146,7 @@ void AudioStreamMonitor::MaybeToggle() {
if (should_indicator_be_on != indicator_was_on) {
was_recently_audible_ = should_indicator_be_on;
- web_contents_->NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
+ audible_change_callback_.Run(was_recently_audible_);
}
if (!should_indicator_be_on) {

Powered by Google App Engine
This is Rietveld 408576698