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

Side by Side Diff: content/browser/media/audio_state_provider.cc

Issue 896673003: Propagate audible state from player to the containing tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments by Daniel and Min Created 5 years, 9 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
OLDNEW
(Empty)
1 #include "content/browser/media/audio_state_provider.h"
2
3 #include "base/logging.h"
4 #include "content/browser/media/audio_stream_monitor.h"
5 #include "content/public/browser/web_contents.h"
6
7 namespace content {
8
9 AudioStateProvider::AudioStateProvider(WebContents* contents)
10 : web_contents_(contents),
11 was_recently_audible_(false) {
12 DCHECK(web_contents_);
13 }
14
15 bool AudioStateProvider::WasRecentlyAudible() const {
16 return was_recently_audible_;
17 }
18
19 void AudioStateProvider::Notify(bool new_state) {
20 if (was_recently_audible_ != new_state) {
21 was_recently_audible_ = new_state;
22 web_contents_->NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
23 }
24 }
25
26 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698