Bug 1579269 Part 1: Make the document inRDMPane property set via a new emulation actor method. r=mtigley

Differential Revision: https://phabricator.services.mozilla.com/D51020

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brad Werth 2019-10-31 21:16:58 +00:00
Родитель 77bedb6124
Коммит b5785ce2c6
3 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -207,6 +207,10 @@ class ResponsiveUI {
// Restore the previous state of RDM.
await this.restoreState();
if (this.isBrowserUIEnabled) {
await this.emulationFront.setDocumentInRDMPane(true);
}
if (!this.isBrowserUIEnabled) {
// Force the newly created Zoom actor to cache its 1.0 zoom level. This
// prevents it from sending out FullZoomChange events when the content
@ -302,6 +306,10 @@ class ResponsiveUI {
await this.inited;
}
if (this.isBrowserUIEnabled) {
await this.emulationFront.setDocumentInRDMPane(false);
}
this.tab.removeEventListener("TabClose", this);
this.tab.removeEventListener("BeforeTabRemotenessChange", this);
this.browserWindow.removeEventListener("unload", this);

Просмотреть файл

@ -460,6 +460,12 @@ const EmulationActor = protocol.ActorClassWithSpec(emulationSpec, {
async captureScreenshot() {
return this.screenshotActor.capture({});
},
async setDocumentInRDMPane(inRDMPane) {
if (this.docShell && this.docShell.document) {
this.docShell.document.inRDMPane = inRDMPane;
}
},
});
exports.EmulationActor = EmulationActor;

Просмотреть файл

@ -179,6 +179,13 @@ const emulationSpec = generateActorSpec({
value: RetVal("json"),
},
},
setDocumentInRDMPane: {
request: {
state: Arg(0, "boolean"),
},
response: {},
},
},
});