зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1625615 - part1 : update 'suspendMediaWhenInactive' when GeckoView setting changes r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D69884
This commit is contained in:
Родитель
f6f59cedd1
Коммит
d09fa27d37
|
@ -128,11 +128,9 @@ class GeckoViewContent extends GeckoViewModule {
|
||||||
} else {
|
} else {
|
||||||
this.browser.docShellIsActive = false;
|
this.browser.docShellIsActive = false;
|
||||||
}
|
}
|
||||||
var msgData = {
|
this.messageManager.sendAsyncMessage("GeckoView:SetActive", {
|
||||||
active: aData.active,
|
active: aData.active,
|
||||||
suspendMedia: this.settings.suspendMediaWhenInactive,
|
});
|
||||||
};
|
|
||||||
this.messageManager.sendAsyncMessage("GeckoView:SetActive", msgData);
|
|
||||||
break;
|
break;
|
||||||
case "GeckoView:SetFocused":
|
case "GeckoView:SetFocused":
|
||||||
if (aData.focused) {
|
if (aData.focused) {
|
||||||
|
|
|
@ -73,6 +73,7 @@ class GeckoViewSettings extends GeckoViewModule {
|
||||||
this.userAgentMode = settings.userAgentMode;
|
this.userAgentMode = settings.userAgentMode;
|
||||||
this.userAgentOverride = settings.userAgentOverride;
|
this.userAgentOverride = settings.userAgentOverride;
|
||||||
this.sessionContextId = settings.sessionContextId;
|
this.sessionContextId = settings.sessionContextId;
|
||||||
|
this.suspendMediaWhenInactive = settings.suspendMediaWhenInactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
get userAgent() {
|
get userAgent() {
|
||||||
|
@ -107,6 +108,16 @@ class GeckoViewSettings extends GeckoViewModule {
|
||||||
this._userAgentOverride = aUserAgent;
|
this._userAgentOverride = aUserAgent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get suspendMediaWhenInactive() {
|
||||||
|
return this.browser.suspendMediaWhenInactive;
|
||||||
|
}
|
||||||
|
|
||||||
|
set suspendMediaWhenInactive(aSuspendMediaWhenInactive) {
|
||||||
|
if (aSuspendMediaWhenInactive != this.browser.suspendMediaWhenInactive) {
|
||||||
|
this.browser.suspendMediaWhenInactive = aSuspendMediaWhenInactive;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get displayMode() {
|
get displayMode() {
|
||||||
return this.window.docShell.displayMode;
|
return this.window.docShell.displayMode;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче