зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1317109 - Remove Acrobat plugin quirk handling. r=jimm
This commit is contained in:
Родитель
5f39e9c1f2
Коммит
c331fa9ecb
|
@ -724,23 +724,6 @@ _geturl(NPP npp, const char* relativeURL, const char* target)
|
||||||
|
|
||||||
PluginDestructionGuard guard(npp);
|
PluginDestructionGuard guard(npp);
|
||||||
|
|
||||||
// Block Adobe Acrobat from loading URLs that are not http:, https:,
|
|
||||||
// or ftp: URLs if the given target is null.
|
|
||||||
if (!target && relativeURL &&
|
|
||||||
(strncmp(relativeURL, "http:", 5) != 0) &&
|
|
||||||
(strncmp(relativeURL, "https:", 6) != 0) &&
|
|
||||||
(strncmp(relativeURL, "ftp:", 4) != 0)) {
|
|
||||||
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *) npp->ndata;
|
|
||||||
|
|
||||||
const char *name = nullptr;
|
|
||||||
RefPtr<nsPluginHost> host = nsPluginHost::GetInst();
|
|
||||||
host->GetPluginName(inst, &name);
|
|
||||||
|
|
||||||
if (name && strstr(name, "Adobe") && strstr(name, "Acrobat")) {
|
|
||||||
return NPERR_NO_ERROR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return MakeNewNPAPIStreamInternal(npp, relativeURL, target,
|
return MakeNewNPAPIStreamInternal(npp, relativeURL, target,
|
||||||
eNPPStreamTypeInternal_Get);
|
eNPPStreamTypeInternal_Get);
|
||||||
}
|
}
|
||||||
|
|
|
@ -290,70 +290,6 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
|
||||||
getter_AddRefs(localFile));
|
getter_AddRefs(localFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (nsCRT::strcmp(charProp, NS_WIN_ACROBAT_SCAN_KEY) == 0) {
|
|
||||||
nsAdoptingCString strVer = Preferences::GetCString(charProp);
|
|
||||||
if (!strVer) {
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
verBlock minVer;
|
|
||||||
TranslateVersionStr(NS_ConvertASCIItoUTF16(strVer).get(), &minVer);
|
|
||||||
|
|
||||||
// Look for Adobe Acrobat system installation plugins directory
|
|
||||||
verBlock maxVer;
|
|
||||||
ClearVersion(&maxVer);
|
|
||||||
|
|
||||||
nsAutoString newestPath;
|
|
||||||
|
|
||||||
rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
|
|
||||||
NS_LITERAL_STRING("software\\Adobe\\Acrobat Reader"),
|
|
||||||
nsIWindowsRegKey::ACCESS_READ);
|
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
|
|
||||||
NS_LITERAL_STRING("software\\Adobe\\Adobe Acrobat"),
|
|
||||||
nsIWindowsRegKey::ACCESS_READ);
|
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We must enumerate through the keys because what if there is
|
|
||||||
// more than one version?
|
|
||||||
uint32_t childCount = 0;
|
|
||||||
regKey->GetChildCount(&childCount);
|
|
||||||
|
|
||||||
for (uint32_t index = 0; index < childCount; ++index) {
|
|
||||||
nsAutoString childName;
|
|
||||||
rv = regKey->GetChildName(index, childName);
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
|
||||||
verBlock curVer;
|
|
||||||
TranslateVersionStr(childName.get(), &curVer);
|
|
||||||
|
|
||||||
childName += NS_LITERAL_STRING("\\InstallPath");
|
|
||||||
|
|
||||||
nsCOMPtr<nsIWindowsRegKey> childKey;
|
|
||||||
rv = regKey->OpenChild(childName, nsIWindowsRegKey::ACCESS_QUERY_VALUE,
|
|
||||||
getter_AddRefs(childKey));
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
|
||||||
// We have a sub key
|
|
||||||
nsAutoString path;
|
|
||||||
rv = childKey->ReadStringValue(NS_LITERAL_STRING(""), path);
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
|
||||||
if (CompareVersion(curVer, maxVer) >= 0 &&
|
|
||||||
CompareVersion(curVer, minVer) >= 0) {
|
|
||||||
newestPath = path;
|
|
||||||
CopyVersion(&maxVer, &curVer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!newestPath.IsEmpty()) {
|
|
||||||
newestPath += NS_LITERAL_STRING("\\browser");
|
|
||||||
rv = NS_NewLocalFile(newestPath, true,
|
|
||||||
getter_AddRefs(localFile));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class nsISimpleEnumerator;
|
||||||
|
|
||||||
// Note: Our directory service provider scan keys are prefs which are check
|
// Note: Our directory service provider scan keys are prefs which are check
|
||||||
// for minimum versions compatibility
|
// for minimum versions compatibility
|
||||||
#define NS_WIN_ACROBAT_SCAN_KEY "plugin.scan.Acrobat"
|
|
||||||
#define NS_WIN_QUICKTIME_SCAN_KEY "plugin.scan.Quicktime"
|
#define NS_WIN_QUICKTIME_SCAN_KEY "plugin.scan.Quicktime"
|
||||||
#define NS_WIN_WMP_SCAN_KEY "plugin.scan.WindowsMediaPlayer"
|
#define NS_WIN_WMP_SCAN_KEY "plugin.scan.WindowsMediaPlayer"
|
||||||
|
|
||||||
|
|
|
@ -1856,10 +1856,6 @@ nsPluginHost::GetSpecialType(const nsACString & aMIMEType)
|
||||||
return eSpecialType_RealPlayer;
|
return eSpecialType_RealPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMIMEType.LowerCaseEqualsASCII("application/pdf")) {
|
|
||||||
return eSpecialType_PDF;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aMIMEType.LowerCaseEqualsASCII("application/vnd.unity")) {
|
if (aMIMEType.LowerCaseEqualsASCII("application/vnd.unity")) {
|
||||||
return eSpecialType_Unity;
|
return eSpecialType_Unity;
|
||||||
}
|
}
|
||||||
|
@ -2559,8 +2555,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
|
||||||
// Scan the installation paths of our popular plugins if the prefs are enabled
|
// Scan the installation paths of our popular plugins if the prefs are enabled
|
||||||
|
|
||||||
// This table controls the order of scanning
|
// This table controls the order of scanning
|
||||||
const char* const prefs[] = {NS_WIN_ACROBAT_SCAN_KEY,
|
const char* const prefs[] = {NS_WIN_QUICKTIME_SCAN_KEY,
|
||||||
NS_WIN_QUICKTIME_SCAN_KEY,
|
|
||||||
NS_WIN_WMP_SCAN_KEY};
|
NS_WIN_WMP_SCAN_KEY};
|
||||||
|
|
||||||
uint32_t size = sizeof(prefs) / sizeof(prefs[0]);
|
uint32_t size = sizeof(prefs) / sizeof(prefs[0]);
|
||||||
|
|
|
@ -205,8 +205,6 @@ public:
|
||||||
// Some IPC quirks
|
// Some IPC quirks
|
||||||
eSpecialType_Silverlight,
|
eSpecialType_Silverlight,
|
||||||
// Native widget quirks
|
// Native widget quirks
|
||||||
eSpecialType_PDF,
|
|
||||||
// Native widget quirks
|
|
||||||
eSpecialType_RealPlayer,
|
eSpecialType_RealPlayer,
|
||||||
// Native widget quirks
|
// Native widget quirks
|
||||||
eSpecialType_Unity };
|
eSpecialType_Unity };
|
||||||
|
|
|
@ -627,17 +627,6 @@ nsresult nsPluginNativeWindowWin::CallSetWindow(RefPtr<nsNPAPIPluginInstance> &a
|
||||||
(WNDPROC)::GetWindowLongPtr((HWND)window, GWLP_WNDPROC);
|
(WNDPROC)::GetWindowLongPtr((HWND)window, GWLP_WNDPROC);
|
||||||
if (!mPrevWinProc && currentWndProc != PluginWndProc)
|
if (!mPrevWinProc && currentWndProc != PluginWndProc)
|
||||||
mPrevWinProc = currentWndProc;
|
mPrevWinProc = currentWndProc;
|
||||||
|
|
||||||
// PDF plugin v7.0.9, v8.1.3, and v9.0 subclass parent window, bug 531551
|
|
||||||
// V8.2.2 and V9.1 don't have such problem.
|
|
||||||
if (mPluginType == nsPluginHost::eSpecialType_PDF) {
|
|
||||||
HWND parent = ::GetParent((HWND)window);
|
|
||||||
if (mParentWnd != parent) {
|
|
||||||
NS_ASSERTION(!mParentWnd, "Plugin's parent window changed");
|
|
||||||
mParentWnd = parent;
|
|
||||||
mParentProc = ::GetWindowLongPtr(mParentWnd, GWLP_WNDPROC);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsPluginNativeWindow::CallSetWindow(aPluginInstance);
|
nsPluginNativeWindow::CallSetWindow(aPluginInstance);
|
||||||
|
|
|
@ -3435,9 +3435,6 @@ pref("print.print_extra_margin", 90); // twips (90 twips is an eigth of an inch)
|
||||||
// Whether to extend the native dialog with information on printing frames.
|
// Whether to extend the native dialog with information on printing frames.
|
||||||
pref("print.extend_native_print_dialog", true);
|
pref("print.extend_native_print_dialog", true);
|
||||||
|
|
||||||
// Locate plugins by scanning the Adobe Acrobat installation directory with a minimum version
|
|
||||||
pref("plugin.scan.Acrobat", "5.0");
|
|
||||||
|
|
||||||
// Locate plugins by scanning the Quicktime installation directory with a minimum version
|
// Locate plugins by scanning the Quicktime installation directory with a minimum version
|
||||||
pref("plugin.scan.Quicktime", "5.0");
|
pref("plugin.scan.Quicktime", "5.0");
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче