Bug 1045008 - Manage search Engine option in new tab is not working (broken) if search bar is removed. r=adw

This commit is contained in:
Alex Bardas 2014-08-06 09:23:00 -04:00
parent 6b0b0c24ca
commit d60c3a80c1

View File

@ -183,7 +183,19 @@ this.ContentSearch = {
_onMessageManageEngines: function (msg, data) {
let browserWin = msg.target.ownerDocument.defaultView;
browserWin.BrowserSearch.searchBar.openManager(null);
let wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
getService(Components.interfaces.nsIWindowMediator);
let window = wm.getMostRecentWindow("Browser:SearchManager");
if (window) {
window.focus()
}
else {
browserWin.setTimeout(function () {
browserWin.openDialog("chrome://browser/content/search/engineManager.xul",
"_blank", "chrome,dialog,modal,centerscreen,resizable");
}, 0);
}
return Promise.resolve();
},