Bug 1228655 - Remove ifdefs for OSX non-browser-window behavior. r=Gijs

This commit is contained in:
Felipe Gomes 2015-12-01 20:05:55 -02:00
Родитель 8b5f42f8a8
Коммит 9cfb99fa0b
1 изменённых файлов: 4 добавлений и 13 удалений

Просмотреть файл

@ -1862,14 +1862,13 @@ function BrowserGoHome(aEvent) {
function loadOneOrMoreURIs(aURIString)
{
#ifdef XP_MACOSX
// we're not a browser window, pass the URI string to a new browser window
if (window.location.href != getBrowserURL())
{
window.openDialog(getBrowserURL(), "_blank", "all,dialog=no", aURIString);
return;
}
#endif
// This function throws for certain malformed URIs, so use exception handling
// so that we don't disrupt startup
try {
@ -1895,7 +1894,6 @@ function openLocation() {
if (focusAndSelectUrlBar())
return;
#ifdef XP_MACOSX
if (window.location.href != getBrowserURL()) {
var win = getTopWin();
if (win) {
@ -1909,7 +1907,6 @@ function openLocation() {
"chrome,all,dialog=no", BROWSER_NEW_TAB_URL);
}
}
#endif
}
function BrowserOpenTab()
@ -2007,13 +2004,11 @@ function BrowserOpenFileWindow()
}
function BrowserCloseTabOrWindow() {
#ifdef XP_MACOSX
// If we're not a browser window, just close the window
if (window.location.href != getBrowserURL()) {
closeWindow(true);
return;
}
#endif
// If the current tab is the last one, this will close the window.
gBrowser.removeCurrentTab({animate: true});
@ -3471,7 +3466,6 @@ const BrowserSearch = {
* or focuses an existing window, if necessary.
*/
webSearch: function BrowserSearch_webSearch() {
#ifdef XP_MACOSX
if (window.location.href != getBrowserURL()) {
var win = getTopWin();
if (win) {
@ -3492,7 +3486,7 @@ const BrowserSearch = {
}
return;
}
#endif
let openSearchPageIfFieldIsNotActive = function(aSearchBar) {
if (!aSearchBar || document.activeElement != aSearchBar.textbox.inputField) {
let url = gBrowser.currentURI.spec.toLowerCase();
@ -6299,14 +6293,11 @@ function warnAboutClosingWindow() {
os.notifyObservers(null, "browser-lastwindow-close-granted", null);
#ifdef XP_MACOSX
// OS X doesn't quit the application when the last window is closed, but keeps
// the session alive. Hence don't prompt users to save tabs, but warn about
// closing multiple tabs.
return isPBWindow || gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL);
#else
return true;
#endif
return AppConstants.platform != "macosx"
|| (isPBWindow || gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL));
}
var MailIntegration = {