| Index: content/browser/media/audio_state_provider.cc
|
| diff --git a/content/browser/media/audio_state_provider.cc b/content/browser/media/audio_state_provider.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..373694c1cb6d0e90245dc348f80dd4f466f68632
|
| --- /dev/null
|
| +++ b/content/browser/media/audio_state_provider.cc
|
| @@ -0,0 +1,26 @@
|
| +#include "content/browser/media/audio_state_provider.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "content/browser/media/audio_stream_monitor.h"
|
| +#include "content/public/browser/web_contents.h"
|
| +
|
| +namespace content {
|
| +
|
| +AudioStateProvider::AudioStateProvider(WebContents* contents)
|
| + : web_contents_(contents),
|
| + was_recently_audible_(false) {
|
| + DCHECK(web_contents_);
|
| +}
|
| +
|
| +bool AudioStateProvider::WasRecentlyAudible() const {
|
| + return was_recently_audible_;
|
| +}
|
| +
|
| +void AudioStateProvider::Notify(bool new_state) {
|
| + if (was_recently_audible_ != new_state) {
|
| + was_recently_audible_ = new_state;
|
| + web_contents_->NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
|
| + }
|
| +}
|
| +
|
| +} // namespace content
|
|
|