Bug 1254865 - Send init for AutoCompletePopup in async message from the parent. r=Felipe

MozReview-Commit-ID: IZ9f8pTTflF

--HG--
extra : rebase_source : 77d97d6ceec1aac296788a702c96288507608c7d
This commit is contained in:
Mike Conley 2016-03-23 14:47:00 -04:00
Родитель 61416ae37e
Коммит 1cfa3e2fe8
2 изменённых файлов: 9 добавлений и 8 удалений

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

@ -632,9 +632,10 @@ addMessageListener("PermitUnload", msg => {
var outerWindowID = content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils)
.outerWindowID;
var initData = sendSyncMessage("Browser:Init", {outerWindowID: outerWindowID});
if (initData.length && initData[0]) {
if (initData[0].initPopup) {
setTimeout(() => AutoCompletePopup.init(), 0);
sendAsyncMessage("Browser:Init", {outerWindowID: outerWindowID});
addMessageListener("Browser:InitReceived", function onInitReceived(msg) {
removeMessageListener("Browser:InitReceived", onInitReceived);
if (msg.data.initPopup) {
AutoCompletePopup.init();
}
}
});

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

@ -430,9 +430,9 @@
switch (aMessage.name) {
case "Browser:Init":
this._outerWindowID = data.outerWindowID;
let result = {};
result.initPopup = this.autoCompletePopup != null;
return result;
this.messageManager.sendAsyncMessage("Browser:InitReceived", {
initPopup: this.autoCompletePopup != null,
});
break;
case "DOMTitleChanged":
this._contentTitle = data.title;