OLD | NEW |
(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 |
OLD | NEW |