Merge pull request #5395 from Snuffleupagus/getTabForBrowser

[Firefox] Use getTabForBrowser instead of _getTabForBrowser if possible
This commit is contained in:
Yury Delendik 2014-10-13 09:16:36 -05:00
commit 55957a7d30
2 changed files with 24 additions and 2 deletions

View File

@ -77,7 +77,18 @@ function getFindBar(domWindow) {
var browser = getContainingBrowser(domWindow);
try {
var tabbrowser = browser.getTabBrowser();
var tab = tabbrowser._getTabForBrowser(browser);
var tab;
//#if MOZCENTRAL
tab = tabbrowser.getTabForBrowser(browser);
//#else
if (tabbrowser.getTabForBrowser) {
tab = tabbrowser.getTabForBrowser(browser);
} else {
// _getTabForBrowser is depreciated in Firefox 35, see
// https://bugzilla.mozilla.org/show_bug.cgi?id=1039500.
tab = tabbrowser._getTabForBrowser(browser);
}
//#endif
return tabbrowser.getFindBar(tab);
} catch (e) {
// FF22 has no _getTabForBrowser, and FF24 has no getFindBar

View File

@ -272,7 +272,18 @@ let PdfjsChromeUtils = {
*/
function PdfjsFindbarWrapper(aBrowser) {
let tabbrowser = aBrowser.getTabBrowser();
let tab = tabbrowser._getTabForBrowser(aBrowser);
let tab;
//#if MOZCENTRAL
tab = tabbrowser.getTabForBrowser(aBrowser);
//#else
if (tabbrowser.getTabForBrowser) {
tab = tabbrowser.getTabForBrowser(aBrowser);
} else {
// _getTabForBrowser is depreciated in Firefox 35, see
// https://bugzilla.mozilla.org/show_bug.cgi?id=1039500.
tab = tabbrowser._getTabForBrowser(aBrowser);
}
//#endif
this._findbar = tabbrowser.getFindBar(tab);
};