mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-29 16:58:28 +00:00
Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.
This also removes some PP abuse and takes file entries out of PP when no longer needed without XP_MACOSX conditionals.
This commit is contained in:
@@ -112,20 +112,8 @@ nsAppShellService::CreateHiddenWindowHelper(bool aIsPrivate)
|
||||
nsresult rv;
|
||||
int32_t initialHeight = 100, initialWidth = 100;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
uint32_t chromeMask = 0;
|
||||
nsAdoptingCString prefVal =
|
||||
Preferences::GetCString("browser.hiddenWindowChromeURL");
|
||||
const char* hiddenWindowURL = prefVal.get() ? prefVal.get() : DEFAULT_HIDDENWINDOW_URL;
|
||||
if (aIsPrivate) {
|
||||
hiddenWindowURL = DEFAULT_HIDDENWINDOW_URL;
|
||||
} else {
|
||||
mApplicationProvidedHiddenWindow = prefVal.get() ? true : false;
|
||||
}
|
||||
#else
|
||||
static const char hiddenWindowURL[] = DEFAULT_HIDDENWINDOW_URL;
|
||||
uint32_t chromeMask = nsIWebBrowserChrome::CHROME_ALL;
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIURI> url;
|
||||
rv = NS_NewURI(getter_AddRefs(url), hiddenWindowURL);
|
||||
@@ -555,26 +543,12 @@ nsAppShellService::CalculateWindowZLevel(nsIXULWindow *aParent,
|
||||
else if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_LOWERED)
|
||||
zLevel = nsIXULWindow::loweredZ;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
/* Platforms on which modal windows are always application-modal, not
|
||||
window-modal (that's just the Mac, right?) want modal windows to
|
||||
be stacked on top of everyone else.
|
||||
|
||||
On Mac OS X, bind modality to parent window instead of app (ala Mac OS 9)
|
||||
*/
|
||||
uint32_t modalDepMask = nsIWebBrowserChrome::CHROME_MODAL |
|
||||
nsIWebBrowserChrome::CHROME_DEPENDENT;
|
||||
if (aParent && (aChromeMask & modalDepMask)) {
|
||||
aParent->GetZLevel(&zLevel);
|
||||
}
|
||||
#else
|
||||
/* Platforms with native support for dependent windows (that's everyone
|
||||
but pre-Mac OS X, right?) know how to stack dependent windows. On these
|
||||
platforms, give the dependent window the same level as its parent,
|
||||
so we won't try to override the normal platform behaviour. */
|
||||
if ((aChromeMask & nsIWebBrowserChrome::CHROME_DEPENDENT) && aParent)
|
||||
aParent->GetZLevel(&zLevel);
|
||||
#endif
|
||||
|
||||
return zLevel;
|
||||
}
|
||||
@@ -661,23 +635,6 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
|
||||
if (aChromeMask & nsIWebBrowserChrome::CHROME_MAC_SUPPRESS_ANIMATION)
|
||||
widgetInitData.mIsAnimationSuppressed = true;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// Mac OS X sheet support
|
||||
// Adding CHROME_OPENAS_CHROME to sheetMask makes modal windows opened from
|
||||
// nsGlobalWindow::ShowModalDialog() be dialogs (not sheets), while modal
|
||||
// windows opened from nsPromptService::DoDialog() still are sheets. This
|
||||
// fixes bmo bug 395465 (see nsCocoaWindow::StandardCreate() and
|
||||
// nsCocoaWindow::SetModal()).
|
||||
uint32_t sheetMask = nsIWebBrowserChrome::CHROME_OPENAS_DIALOG |
|
||||
nsIWebBrowserChrome::CHROME_MODAL |
|
||||
nsIWebBrowserChrome::CHROME_OPENAS_CHROME;
|
||||
if (parent &&
|
||||
(parent != mHiddenWindow && parent != mHiddenPrivateWindow) &&
|
||||
((aChromeMask & sheetMask) == sheetMask)) {
|
||||
widgetInitData.mWindowType = eWindowType_sheet;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(XP_WIN)
|
||||
if (widgetInitData.mWindowType == eWindowType_toplevel ||
|
||||
widgetInitData.mWindowType == eWindowType_dialog)
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDocument.h"
|
||||
#if defined(XP_MACOSX)
|
||||
#include "nsThreadUtils.h"
|
||||
#endif
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
@@ -906,28 +903,6 @@ nsContentTreeOwner::ProvideWindow(mozIDOMWindowProxy* aParent,
|
||||
// nsContentTreeOwner: Accessors
|
||||
//*****************************************************************************
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
class nsContentTitleSettingEvent : public Runnable
|
||||
{
|
||||
public:
|
||||
nsContentTitleSettingEvent(dom::Element* dse, const nsAString& wtm)
|
||||
: mElement(dse),
|
||||
mTitleDefault(wtm) {}
|
||||
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
ErrorResult rv;
|
||||
mElement->SetAttribute(NS_LITERAL_STRING("titledefault"), mTitleDefault, rv);
|
||||
mElement->RemoveAttribute(NS_LITERAL_STRING("titlemodifier"), rv);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
nsCOMPtr<dom::Element> mElement;
|
||||
nsString mTitleDefault;
|
||||
};
|
||||
#endif
|
||||
|
||||
void nsContentTreeOwner::XULWindow(nsXULWindow* aXULWindow)
|
||||
{
|
||||
mXULWindow = aXULWindow;
|
||||
@@ -946,18 +921,6 @@ void nsContentTreeOwner::XULWindow(nsXULWindow* aXULWindow)
|
||||
docShellElement->GetAttribute(NS_LITERAL_STRING("titledefault"), mTitleDefault);
|
||||
docShellElement->GetAttribute(NS_LITERAL_STRING("titlemodifier"), mWindowTitleModifier);
|
||||
docShellElement->GetAttribute(NS_LITERAL_STRING("titlepreface"), mTitlePreface);
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
// On OS X, treat the titlemodifier like it's the titledefault, and don't ever append
|
||||
// the separator + appname.
|
||||
if (mTitleDefault.IsEmpty()) {
|
||||
NS_DispatchToCurrentThread(
|
||||
new nsContentTitleSettingEvent(docShellElement,
|
||||
mWindowTitleModifier));
|
||||
mTitleDefault = mWindowTitleModifier;
|
||||
mWindowTitleModifier.Truncate();
|
||||
}
|
||||
#endif
|
||||
docShellElement->GetAttribute(NS_LITERAL_STRING("titlemenuseparator"), mTitleSeparator);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
#include "nsPIWindowRoot.h"
|
||||
|
||||
#if defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
#include "nsINativeMenuService.h"
|
||||
#define USE_NATIVE_MENUS
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 ci et: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
@@ -1040,7 +1039,7 @@ void nsXULWindow::OnChromeLoaded()
|
||||
|
||||
bool positionSet = !mIgnoreXULPosition;
|
||||
nsCOMPtr<nsIXULWindow> parentWindow(do_QueryReferent(mParentWindow));
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
#if defined(XP_UNIX)
|
||||
// don't override WM placement on unix for independent, top-level windows
|
||||
// (however, we think the benefits of intelligent dependent window placement
|
||||
// trump that override.)
|
||||
|
||||
Reference in New Issue
Block a user