Bug 1059424 Part 2: Simplify nsAppFileLocationProvider Java plugin detection now that we are minimum macOS 10.9.
MozReview-Commit-ID: CkmH2ngEDKT
--- a/xpcom/io/nsAppFileLocationProvider.cpp
+++ b/xpcom/io/nsAppFileLocationProvider.cpp
@@ -10,17 +10,16 @@
#include "nsEnumeratorUtils.h"
#include "nsIAtom.h"
#include "nsIFile.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsISimpleEnumerator.h"
#include "prenv.h"
#include "nsCRT.h"
-
#if defined(MOZ_WIDGET_COCOA)
#include <Carbon/Carbon.h>
#include "nsILocalFileMac.h"
#elif defined(XP_WIN)
#include <windows.h>
#include <shlobj.h>
#elif defined(XP_UNIX)
#include <unistd.h>
@@ -549,17 +548,16 @@ nsAppFileLocationProvider::GetFiles(cons
// "normal" locations. So we won't be able to find it unless we look in the "non-normal"
// location where it actually is. Safari can use the WebKit-specific JavaPluginCocoa.bundle,
// which (of course) is still fully supported on OS X 10.5. But we have no alternative to
// using Java Plugin2. For more information see bug 668639.
static const char* keys[] = {
NS_APP_PLUGINS_DIR,
NS_MACOSX_USER_PLUGIN_DIR,
NS_MACOSX_LOCAL_PLUGIN_DIR,
- IsOSXLeopard() ? NS_MACOSX_JAVA2_PLUGIN_DIR : nullptr,
nullptr
};
*aResult = new nsAppDirectoryEnumerator(this, keys);
#else
#ifdef XP_UNIX
static const char* keys[] = { nullptr, NS_USER_PLUGINS_DIR, NS_APP_PLUGINS_DIR, NS_SYSTEM_PLUGINS_DIR, nullptr };
#else
static const char* keys[] = { nullptr, NS_USER_PLUGINS_DIR, NS_APP_PLUGINS_DIR, nullptr };
@@ -583,27 +581,8 @@ nsAppFileLocationProvider::GetFiles(cons
NS_ADDREF(*aResult);
rv = NS_OK;
}
if (!strcmp(aProp, NS_APP_DISTRIBUTION_SEARCH_DIR_LIST)) {
return NS_NewEmptyEnumerator(aResult);
}
return rv;
}
-
-#if defined(MOZ_WIDGET_COCOA)
-bool
-nsAppFileLocationProvider::IsOSXLeopard()
-{
- static SInt32 version = 0;
-
- if (!version) {
- OSErr err = ::Gestalt(gestaltSystemVersion, &version);
- if (err != noErr) {
- version = 0;
- } else {
- version &= 0xFFFF; // The system version is in the low order word
- }
- }
-
- return ((version >= 0x1050) && (version < 0x1060));
-}
-#endif