mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 580901 - Directly call loadOneTab instead of Tabs.open
Remove Tabs.open and BrowserWindow.addTab and directly deal with xul tabs.
This commit is contained in:
parent
feb4cee8cc
commit
c7e09a7426
@ -1267,7 +1267,7 @@ window.Group.prototype = iQ.extend(new Item(), new Subscribable(), {
|
||||
// Creates a new tab within this group.
|
||||
newTab: function(url) {
|
||||
Groups.setActiveGroup(this);
|
||||
var newTab = Tabs.open(url || "about:blank", true);
|
||||
let newTab = gBrowser.loadOneTab(url || "about:blank", {inBackground: true});
|
||||
|
||||
// Because opening a new tab happens in a different thread(?)
|
||||
// calling Page.hideChrome() inline won't do anything. Instead
|
||||
@ -1308,7 +1308,7 @@ window.Group.prototype = iQ.extend(new Item(), new Subscribable(), {
|
||||
duration: 270,
|
||||
complete: function(){
|
||||
iQ(tab.container).css({opacity: 1});
|
||||
newTab.focus();
|
||||
gBrowser.selectedTab = newTab;
|
||||
Page.showChrome()
|
||||
gWindow.gURLBar.focus();
|
||||
$anim.remove();
|
||||
|
@ -170,22 +170,6 @@ window.TabsManager = iQ.extend(new Subscribable(), {
|
||||
return null;
|
||||
},
|
||||
|
||||
// ----------
|
||||
open: function open(url, inBackground) {
|
||||
if (typeof(inBackground) == 'undefined')
|
||||
inBackground = false;
|
||||
|
||||
var browserWindow = windows.focused;
|
||||
// TODO: What to do if we have no focused window?
|
||||
// make a new one?
|
||||
|
||||
var tab = browserWindow.addTab(url);
|
||||
if (!inBackground)
|
||||
browserWindow.selectedTab = tab; // TODO doesn't seem to be working
|
||||
|
||||
return tab;
|
||||
},
|
||||
|
||||
// ----------
|
||||
toString: function toString() {
|
||||
return "[Tabs]";
|
||||
@ -276,13 +260,6 @@ window.TabsManager = iQ.extend(new Subscribable(), {
|
||||
tabbrowser.tabContainer.addEventListener(eventType, onEvent, true);
|
||||
});
|
||||
|
||||
this.addTab = function addTab(url) {
|
||||
var chromeTab = tabbrowser.addTab(url);
|
||||
// The TabOpen event has just been triggered, so we
|
||||
// just need to fetch its BrowserTab object now.
|
||||
return chromeTab.tabcandyBrowserTab;
|
||||
};
|
||||
|
||||
this.getFocusedTab = function getFocusedTab() {
|
||||
return tabbrowser.selectedTab.tabcandyBrowserTab;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user