Bug 1110069 - Replace getBrowser() with gBrowser in /browser. r=dao

This commit is contained in:
Ankit Goyal 2014-12-11 21:48:00 -05:00
parent 0afd9824a9
commit d8c264deb7
6 changed files with 17 additions and 17 deletions

View File

@ -7,7 +7,7 @@ var gSafeBrowsing = {
setReportPhishingMenu: function() {
// A phishing page will have a specific about:blocked content documentURI
var uri = getBrowser().currentURI;
var uri = gBrowser.currentURI;
var isPhishingPage = uri && uri.spec.startsWith("about:blocked?e=phishingBlocked");
// Show/hide the appropriate menu item.

View File

@ -1058,7 +1058,7 @@
const kXULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
let addEngines = getBrowser().mCurrentBrowser.engines;
let addEngines = gBrowser.mCurrentBrowser.engines;
if (addEngines && addEngines.length > 0) {
const kBundleURI = "chrome://browser/locale/search.properties";
let bundle = Services.strings.createBundle(kBundleURI);

View File

@ -452,7 +452,7 @@ WebContentConverterRegistrar.prototype = {
}
};
var browserElement = this._getBrowserForContentWindow(browserWindow, aContentWindow);
var notificationBox = browserWindow.getBrowser().getNotificationBox(browserElement);
var notificationBox = browserWindow.gBrowser.getNotificationBox(browserElement);
notificationBox.appendNotification(message,
notificationValue,
notificationIcon,
@ -481,7 +481,7 @@ WebContentConverterRegistrar.prototype = {
var browserWindow = this._getBrowserWindowForContentWindow(aContentWindow);
var browserElement = this._getBrowserForContentWindow(browserWindow, aContentWindow);
var notificationBox = browserWindow.getBrowser().getNotificationBox(browserElement);
var notificationBox = browserWindow.gBrowser.getNotificationBox(browserElement);
this._appendFeedReaderNotification(uri, aTitle, notificationBox);
}
else
@ -516,7 +516,7 @@ WebContentConverterRegistrar.prototype = {
function WCCR__getBrowserForContentWindow(aBrowserWindow, aContentWindow) {
// This depends on pseudo APIs of browser.js and tabbrowser.xml
aContentWindow = aContentWindow.top;
var browsers = aBrowserWindow.getBrowser().browsers;
var browsers = aBrowserWindow.gBrowser.browsers;
for (var i = 0; i < browsers.length; ++i) {
if (browsers[i].contentWindow == aContentWindow)
return browsers[i];

View File

@ -349,7 +349,7 @@
popup.removeChild(items[i]);
}
var addengines = getBrowser().mCurrentBrowser.engines;
var addengines = gBrowser.mCurrentBrowser.engines;
if (addengines && addengines.length > 0) {
const kXULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

View File

@ -217,7 +217,7 @@ let CommandUtils = {
},
get window() {
return this.chromeWindow.getBrowser().selectedTab.linkedBrowser.contentWindow;
return this.chromeWindow.gBrowser.selectedTab.linkedBrowser.contentWindow;
},
get document() {
@ -296,7 +296,7 @@ DeveloperToolbar.prototype.NOTIFICATIONS = NOTIFICATIONS;
*/
Object.defineProperty(DeveloperToolbar.prototype, "target", {
get: function() {
return TargetFactory.forTab(this._chromeWindow.getBrowser().selectedTab);
return TargetFactory.forTab(this._chromeWindow.gBrowser.selectedTab);
},
enumerable: true
});
@ -410,7 +410,7 @@ DeveloperToolbar.prototype.show = function(focus) {
return gcli.load().then(() => {
this.display = gcli.createDisplay({
contentDocument: this._chromeWindow.getBrowser().contentDocument,
contentDocument: this._chromeWindow.gBrowser.contentDocument,
chromeDocument: this._doc,
chromeWindow: this._chromeWindow,
hintElement: this.tooltipPanel.hintElement,
@ -433,7 +433,7 @@ DeveloperToolbar.prototype.show = function(focus) {
this.tooltipPanel);
this.display.onOutput.add(this.outputPanel._outputChanged, this.outputPanel);
let tabbrowser = this._chromeWindow.getBrowser();
let tabbrowser = this._chromeWindow.gBrowser;
tabbrowser.tabContainer.addEventListener("TabSelect", this, false);
tabbrowser.tabContainer.addEventListener("TabClose", this, false);
tabbrowser.addEventListener("load", this, true);
@ -500,7 +500,7 @@ DeveloperToolbar.prototype.hide = function() {
* @private
*/
DeveloperToolbar.prototype._devtoolsUnloaded = function() {
let tabbrowser = this._chromeWindow.getBrowser();
let tabbrowser = this._chromeWindow.gBrowser;
Array.prototype.forEach.call(tabbrowser.tabs, this._stopErrorsCount, this);
};
@ -509,7 +509,7 @@ DeveloperToolbar.prototype._devtoolsUnloaded = function() {
* @private
*/
DeveloperToolbar.prototype._devtoolsLoaded = function() {
let tabbrowser = this._chromeWindow.getBrowser();
let tabbrowser = this._chromeWindow.gBrowser;
this._initErrorsCount(tabbrowser.selectedTab);
};
@ -575,7 +575,7 @@ DeveloperToolbar.prototype.destroy = function() {
return; // Already destroyed
}
let tabbrowser = this._chromeWindow.getBrowser();
let tabbrowser = this._chromeWindow.gBrowser;
tabbrowser.tabContainer.removeEventListener("TabSelect", this, false);
tabbrowser.tabContainer.removeEventListener("TabClose", this, false);
tabbrowser.removeEventListener("load", this, true);
@ -624,7 +624,7 @@ DeveloperToolbar.prototype.handleEvent = function(ev) {
if (ev.type == "TabSelect" || ev.type == "load") {
if (this.visible) {
this.display.reattach({
contentDocument: this._chromeWindow.getBrowser().contentDocument
contentDocument: this._chromeWindow.gBrowser.contentDocument
});
if (ev.type == "TabSelect") {
@ -676,7 +676,7 @@ DeveloperToolbar.prototype._onPageBeforeUnload = function(ev) {
return;
}
let tabs = this._chromeWindow.getBrowser().tabs;
let tabs = this._chromeWindow.gBrowser.tabs;
Array.prototype.some.call(tabs, function(tab) {
if (tab.linkedBrowser.contentWindow === window) {
let tabId = tab.linkedPanel;
@ -701,7 +701,7 @@ DeveloperToolbar.prototype._onPageBeforeUnload = function(ev) {
* selected tab, then the button is not updated.
*/
DeveloperToolbar.prototype._updateErrorsCount = function(changedTabId) {
let tabId = this._chromeWindow.getBrowser().selectedTab.linkedPanel;
let tabId = this._chromeWindow.gBrowser.selectedTab.linkedPanel;
if (changedTabId && tabId != changedTabId) {
return;
}

View File

@ -94,7 +94,7 @@ Window.prototype = {
},
get _tabbrowser() {
return this._window.getBrowser();
return this._window.gBrowser;
},
/*