Bug 1263647 - When receiving a TabPreZombify event, send out a Tab:AudioPlayingChange message only if the tab is actually playing some audio. r=margaret

MozReview-Commit-ID: 7eAc2mNgM42
This commit is contained in:
Jan Henning 2016-04-14 16:18:00 -07:00
parent ca88fcd131
commit da383eac05

View File

@ -4086,9 +4086,15 @@ Tab.prototype = {
break;
}
case "DOMAudioPlaybackStarted":
case "DOMAudioPlaybackStopped":
case "TabPreZombify": {
if (!this.playingAudio) {
return;
}
// Fall through to the DOMAudioPlayback events, so the
// audio playback indicator gets reset upon zombification.
}
case "DOMAudioPlaybackStarted":
case "DOMAudioPlaybackStopped": {
if (!Services.prefs.getBoolPref("browser.tabs.showAudioPlayingIcon") ||
!aEvent.isTrusted) {
return;