Bug 517704 - use gBrowser instead of getBrowser() in Places code. r=mak

This commit is contained in:
Dão Gottwald 2009-09-20 12:58:27 +02:00
parent e2edb17057
commit 7ac2f9cfd4
3 changed files with 11 additions and 13 deletions

View File

@ -450,7 +450,7 @@ var PlacesCommandHook = {
* Adds a bookmark to the page loaded in the current tab.
*/
bookmarkCurrentPage: function PCH_bookmarkCurrentPage(aShowEditUI, aParent) {
this.bookmarkPage(getBrowser().selectedBrowser, aParent, aShowEditUI);
this.bookmarkPage(gBrowser.selectedBrowser, aParent, aShowEditUI);
},
/**
@ -484,19 +484,18 @@ var PlacesCommandHook = {
*/
_getUniqueTabInfo: function BATC__getUniqueTabInfo() {
var tabList = [];
var seenURIs = [];
var seenURIs = {};
var browsers = getBrowser().browsers;
var browsers = gBrowser.browsers;
for (var i = 0; i < browsers.length; ++i) {
var webNav = browsers[i].webNavigation;
var uri = webNav.currentURI;
let uri = browsers[i].currentURI;
// skip redundant entries
if (uri.spec in seenURIs)
continue;
// add to the set of seen URIs
seenURIs[uri.spec] = true;
seenURIs[uri.spec] = null;
tabList.push(uri);
}
return tabList;
@ -1166,7 +1165,7 @@ var PlacesStarButton = {
if (!starIcon)
return;
var uri = getBrowser().currentURI;
var uri = gBrowser.currentURI;
this._starred = uri && (PlacesUtils.getMostRecentBookmarkForURI(uri) != -1 ||
PlacesUtils.getMostRecentFolderForFeedURI(uri) != -1);
if (this._starred) {

View File

@ -918,8 +918,7 @@ var PlacesUIUtils = {
var loadInBackground = where == "tabshifted" ? true : false;
var replaceCurrentTab = where == "tab" ? false : true;
browserWindow.getBrowser().loadTabs(urls, loadInBackground,
replaceCurrentTab);
browserWindow.gBrowser.loadTabs(urls, loadInBackground, replaceCurrentTab);
},
openContainerNodeInTabs: function PU_openContainerInTabs(aNode, aEvent) {

View File

@ -90,8 +90,8 @@ function test() {
info("new load count is " + loadCount);
if (loadCount == 3) {
window.getBrowser().removeEventListener("DOMContentLoaded", handleLoad, true);
window.content.document.location.href = "about:blank";
gBrowser.removeEventListener("DOMContentLoaded", handleLoad, true);
content.location.href = "about:blank";
executeSoon(check_next_uri);
}
}
@ -100,8 +100,8 @@ function test() {
if (URIs.length) {
let uri = URIs.shift();
loadCount = 0;
window.getBrowser().addEventListener("DOMContentLoaded", handleLoad, true);
window.content.document.location.href = uri;
gBrowser.addEventListener("DOMContentLoaded", handleLoad, true);
content.location.href = uri;
}
else {
setTimeout(confirm_results, LAZY_ADD_TIMER * 2);